I'm using Devise's built in before_filter :authenticate_user!
. I want to call my own custom method in my application helper if a user fails the before filter (tries to do an action when logged out). How and where can I do this?
Instead of calling before_filter :authenticate_user!
write your own function in your controller that calls authenticate_user!
. Something like:
before_filter :logged_in
...
private
def logged_in
your_function
authenticate_user!
end