I need to execute a method before certains actions in a rails app and apparently the right way to go is using a before_filter.
The before_开发者_如何转开发filter works fine when a put the filter method in the controller, but I need to use this filter in all the controllers, and I don't think would be right repeat the filter code en each one of them. So, I moved the code to the application controller, but it stopped work.
I don't know if I'm calling it wrongly, I don't know. What is the right way to do this?
PD: I call the filter this way
:before_filter => :get_language
try before_filter not :before_filter (symbol)
精彩评论