Hello, How can i apply a before_filter on all controllers in application.rb without some specific controllers. Is there something like :only and :except for controllers like there is for methods? -- Posted via http://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, Pawel Jur wrote:> How can i apply a before_filter on all controllers in application.rb > without some specific controllers. Is there something like :only and > :except for controllers like there is for methods?You can use skip_after_filter, skip_before_filter, or skip_filter to skip filters in a controller. http://api.rubyonrails.com/classes/ActionController/Filters/ClassMethods.html Lutz -- Posted via http://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Lutz Horn wrote:> Hi, > > Pawel Jur wrote: >> How can i apply a before_filter on all controllers in application.rb >> without some specific controllers. Is there something like :only and >> :except for controllers like there is for methods? > > You can use skip_after_filter, skip_before_filter, or skip_filter to > skip filters in a controller. > > http://api.rubyonrails.com/classes/ActionController/Filters/ClassMethods.html > > LutzWow, skip_filter .. nice! :) thanks. just what i was looking for. -- Posted via http://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---