From: Rick DeNatale Date: 2007-12-07T00:15:33+09:00 Subject: Re: how(where) to define a method that to be called by views? On 12/6/07, Sun wrote: > Hi, > > I just dabbed Ruby on rails abit and what to know where is the right place > to define a method, that prinf some output information to views, based on > some variable. > > I define a function "def foo " in contrioller but the calling from a view > "test.rhtml" give errors. I google a while and did not find a quick answer > for this. Or shall I do this in helper class? > > May some one shed some light on this? Yes that's what helpers are for. Also, the rails-talk list is a better place to ask questions about rails. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/