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 -- Posted via http://www.ruby-forum.com/.
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? > > ThanksYou 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 -- Posted via http://www.ruby-forum.com/.
On 6/7/06, Gokhan Arli <gokhan@sylow.net> wrote:> 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. > > 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.