Skip to content

How To: Require authentication for all pages

fgrehm edited this page Feb 26, 2013 · 8 revisions

In case your app requires users to be authenticated for all pages and to avoid the "You need to sign in or sign up before continuing." message when trying to access the application root, add this to your routes.rb:

authenticated :user do
  root :to => 'home#index'
end
root :to => redirect('/users/sign_in')

Clone this wiki locally