ruby on rails - How to require authentication for all pages with Devise? -


i have started use devise gem , trying implement code, web app require login each , every page on app. have added following code routes.rb according this instruction:

authenticated :user   root to: 'home#index', as: :authenticated_root end root to: redirect('/users/sign_in') 

but doesn't work. when go page - open page, , doesn't forward me sign_in page. please clarify missed? appreciated.

add app controller

class applicationcontroller < actioncontroller::base   ...   before_action :authenticate_user! end 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -