Ruby on Rails Friday, July 2, 2010

Making it a before_filter makes it so you won't need to call the
method to set your banner every single time. It will be done before
any action is called.

On Jul 2, 12:25 pm, bingo bob <li...@ruby-forum.com> wrote:
> Aha !
>
> "You could put the @banner_url = BannerAdvert.. in you
> application_controller.rb. Make it a before_filter."
>
> That's the bit I missed then, I just stuck @banner_url =
> BannerAdvert.first in the application_controller.rb, I need a
> before_filter to call a method in that controller - that right ?
> --
> 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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment