Reputation: 363
Is there a simple way to do this? How do I always trigger this controller, no matter on which page user tries to get?
Upvotes: 0
Views: 316
Reputation: 5294
You can add a before_filter
to ApplicationController
:
before_filter :login_required
protected
def login_required
redirect_to root_url if not logged_in?
end
Upvotes: 1