How to have multiple paths display URL as root
- by Verdi Erel Ergün
I want users#new and tasks#index to display as the root path URL, i.e. / When a user logs in on the path users#new (set as root) they are redirected to tasks#index and URL does not change. Can this be done in the routes.rb file?
This is my routes.rb file:
Todo::Application.routes.draw do
resources :sessions
resources :subscriptions
resources :users
resources :tasks do
collection do
post :sort
end
end
root :to => "users#new"
match "sessions#new" => "tasks#index"
match "sessions#" => "tasks#index"