Rails - Specifiy Root Path w / Custom URL: '/ dashboard'

How to make this root path as follows: '/ dashboard' instead of http://example.com ?

root :to => 'dashboard#index', :constraints => lambda{|req| !req.session[:user_id].blank?}
+5
source share
1 answer

You can accomplish this with:

root :to => redirect('/dashboard')
match '/dashboard', :to => "dashboard#index",
  :constraints => lambda {|req| !req.session[:user_id].blank? }
+9
source

All Articles