Forum: Ruby on Rails Qick Q: Expression in this Controller

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
224b787861d66cc06fa539df14672763?d=identicon&s=25 Dominic Son (Guest)
on 2006-06-08 00:17
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
54077fb03c95861af85880218cf7aef2?d=identicon&s=25 Gokhan Arli (sylow)
on 2006-06-08 00:45
Dominic Son 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
58c44a4a506d878f9a112f1d7b7cb87e?d=identicon&s=25 Jeremy Evans (Guest)
on 2006-06-08 18:05
(Received via mailing list)
On 6/7/06, Gokhan Arli <gokhan@sylow.net> 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. :)

Hint: ruby is case sensitive.
This topic is locked and can not be replied to.