Qick Q: Expression in this Controller


#1

I tried putting this inside my controller:

def goodbye
@link = Link_to “goodbye!”, :action =>“goodbye”
end

and display it in my views calling the @link variable.

Of course it doesn’t work.

Why?

Thanks


#2

Dominic S. wrote:

I tried putting this inside my controller:

def goodbye
@link = Link_to “goodbye!”, :action =>“goodbye”
end

and display it in my views calling the @link variable.

Of course it doesn’t work.

Why?

Thanks

You need this function in your helpers so it will be available in your
views and then you can use as
<%= goodbye %>.

Gokhan
www.sylow.net


#3

On 6/7/06, Gokhan A. removed_email_address@domain.invalid wrote:

You need this function in your helpers so it will be available in your
views and then you can use as
<%= goodbye %>.

That just moves the NameError to a different place in the code. :slight_smile:

Hint: ruby is case sensitive.