Raimon Fs
2007-Dec-03 13:46 UTC
before_filter application => exclude some other controllers
Hello again,
It''s possible to use before_filter in the application_controller, and
exclude for some methods from other controllers ?
i have a before_filter in application_controller that checks if the user
is logged, if the time hasn''t expired, ... and I want to exclude some
methods of this check, like the login. This ''login'' belongs to
other
controller.
I can put those before_filter in every control that will need it, but
all of my controls need it, so I prefer to put it in the
application_controller.
thanks,
raimon
ps. this doesn''t work
before_filter (:session_expiry => :except ) {|login_controller|}
--
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
-~----------~----~----~----~------~----~------~--~---
William Pratt
2007-Dec-03 15:59 UTC
Re: before_filter application => exclude some other controllers
Add this to your login_controller: skip_before_filter :session_expiry -Bill Raimon Fs wrote:> Hello again, > > > It''s possible to use before_filter in the application_controller, and > exclude for some methods from other controllers ? > > > i have a before_filter in application_controller that checks if the user > is logged, if the time hasn''t expired, ... and I want to exclude some > methods of this check, like the login. This ''login'' belongs to other > controller. > > I can put those before_filter in every control that will need it, but > all of my controls need it, so I prefer to put it in the > application_controller. > > > thanks, > > > raimon > > > ps. this doesn''t work > > before_filter (:session_expiry => :except ) {|login_controller|} >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Raimon Fs
2007-Dec-03 16:16 UTC
Re: before_filter application => exclude some other controll
William Pratt wrote:> Add this to your login_controller: > > skip_before_filter :session_expiry > > -Billthanks, sounds more logical ... regards, raimon -- 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 -~----------~----~----~----~------~----~------~--~---
Possibly Parallel Threads
- Plugin: can't call before_filter in ApplicationController
- uninitialized constant LoginController in Ruby
- Why before_filter is not working?
- [PATCH] gettext initiation problem Thanks to Thibault Deloffre <tdeloffre@linagora.com>
- Setting a global before_filter action in application.rb