I am using devise and I have a root pointing home#index, now I want to override devise when a user register or login to redirect to project#show instead of the root(home#index). What method do I put in the overidden devise controller? Also do I have to add anything in the routes.rb?
Thank you in advance!
class RegistrationsController < Devise::RegistrationsController
end
routes.rb
Parks::Application.routes.draw do
resources :home, :project
devise_for :users
root :to => "home#index"
end
available path
show_project_path
I think the
after_sign_in_path_forhook is what you’re looking for: http://rdoc.info/github/plataformatec/devise/master/Devise/Controllers/Helpers:after_sign_in_path_forAs you can see from the docs, you can define a route that will automatically be used (by the original implementation of the hook) or you can override it completely.