I’m using devise for auth and want to have the authenticated user route to locations#show. A user belongs to a location. I’ve tried a couple things including this in routes
authenticated :user do
match 'locations/:id' => 'locations#show', :as => :root
end
Unfortunately that doesn’t change a thing and routes to home#index even when logged in. My full routes file
authenticated :user do
match 'locations/:id' => 'locations#show', :as => :root
end
root :to => "home#index"
resources :locations
devise_for :users
resources :users
Any ideas on how to have the root show the location id when a user is logged in?
I ended up first defining the after sign in path in my applications controller
Then I setup my route like this