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
Post a Comment