Skip to content

Instantly share code, notes, and snippets.

@rahuldstiwari
Created October 16, 2018 05:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahuldstiwari/8f6ddff43486c123aac5ecd3089e1a1d to your computer and use it in GitHub Desktop.
Save rahuldstiwari/8f6ddff43486c123aac5ecd3089e1a1d to your computer and use it in GitHub Desktop.
Devise authenticated routes in rails
resources :users
devise_for :users, controllers: { sessions: 'users/sessions',registrations: 'users/registrations' ,passwords: 'users/passwords' }
devise_scope :user do
unauthenticated :user do
root :to => "users/sessions#new"
end
authenticated :user do
root :to => 'dashboard#index', as: :authenticated_path
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment