Forum: Ruby on Rails Double redirect

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.
Bd3a4af368439803aa37d318f9941a9f?d=identicon&s=25 David (Guest)
on 2006-04-11 21:55
I have two before_filters for my application that both redirect.  The
first checks whether there is an active session and if so, whether it
has timed out (a la the recipes book).  This is run from
ApplicationController.  The second filter is in use throughout most of
the app and checks to see whether the user has the correct credentials
to view the controller.  This is run from individual controllers that
need it.

Both have a redirect if they fail, however the redirect for
check_timeout never runs, because it also fails the check_user test
which causes it to redirect and cause the error.

How can I stop the application from running further checks if the first
filter fails?  I have tried "redirect_to and return" which was suggested
on a website I found, but it does not seem to alter the situation.  It's
not a showstopper if I can't, but it would be preferable.

Thanks,

David
41e1579600683eed6c00af9a425268e6?d=identicon&s=25 Edward Frederick (Guest)
on 2006-04-11 21:58
(Received via mailing list)
You've tried redirect_to and return false?

Return false stops future filters.
This topic is locked and can not be replied to.