Forum: Ruby on Rails can befor_filter expect other controller's action?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
bin.liu (Guest)
on 2006-03-23 04:44
i put
  befor_filter :setup_user,:except=>:login
in ApplicationController.rb
but i want to put action login to other controller
how can i do it?
does rails has this support?
  befor_filter
:setup_user,:except=>{{controller=>'user',action=>'login'},...}
Norman T. (Guest)
on 2006-03-23 14:05
(Received via mailing list)
Am Donnerstag, den 23.03.2006, 03:44 +0100 schrieb bin.liu:
> i put
>   befor_filter :setup_user,:except=>:login
> in ApplicationController.rb
> but i want to put action login to other controller
> how can i do it?
> does rails has this support?
>   befor_filter
> :setup_user,:except=>{{controller=>'user',action=>'login'},...}

No it is not supported, but you could define the logic of your action in
the application controller and call it from any login action of your
child controllers.

The question is: Do you have different login actions in your
controllers? Why do you want to only exclude the login action on your
user controller?
--
Norman T.

http://blog.inlet-media.de
This topic is locked and can not be replied to.