Can befor_filter expect other controller's action?


#1

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’},…}


#2

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