But where shhould the method live? In the Application controller? def twitter_search ... end
On 2 Nov., 23:21, Euwyn Poon <[email protected]> wrote: > If I'm not mistaken, you have TwitterController and a DashboardController. > You could have a before_filter (to set @twitter_search) in each of these for > the methods that result in the partial being rendered. I suppose you could > also have a before_filter in the ApplicationController, but not sure that's > the best idea. > > Euwyn > > On Mon, Nov 2, 2009 at 10:31 AM, andkjaer <[email protected]> wrote: > > > Thanks Robert, > > But one question. > > Where do I put the code called by an :before_filter > > In the application_controller ? > > > On 2 Nov., 15:54, Robert Walker <[email protected]> > > wrote: > > > Robert Walker wrote: > > > > Keep in mind that instance variables set in controllers are only > > > > available for one request/response cycle. Any data you need for a view > > > > you should assign in the controller action used to render the view. > > > > Also remember that before_filter can be used in cases where you need to > > > load data for multiple actions within a controller. This will help keep > > > your code DRY. > > > -- > > > Posted viahttp://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

