How to set the developer sign on the page as the root page in rails

I have a personality.

I would like to set the mark on the page for the dash device as the root page for my project.

What changes should be made to routes.rb ?

Rails Version: 3.2.14

rake routes gives me the following for root

  root / devise/sessions#new 

but still I get a welcome page on raids. (Local: 3000)

+4
ruby-on-rails root devise
Nov 08 '13 at 9:44
source share
1 answer

Add this to your routes. rb

 devise_scope :user do root :to => 'devise/sessions#new' end 

but at the same time, after logging in, you can get stuck in an endless loop error, so itโ€™s better to add it after logging in and leaving the path in your application controller, overriding development methods

 def after_sign_in_path_for(resource_or_scope) # your_path end def after_sign_out_path_for(resource_or_scope) # your_path end 

It will work!

+20
Nov 08 '13 at 9:49
source share



All Articles