katie
katie

Reputation: 2951

How to override devise redirection?

I need to override devise in a such way that when user sign up or login to redirect him to show_home_url instead of root_path(home#index).But i am not sure if after_sign_up_path_for or after_inactive_sign_up_path_for is what i need.Also whatever choice that is can anybody please show me how to implement that? i am a begginner in ruby.Here is Devise registration controller Thank you very much.

      class RegistrationsController < Devise::RegistrationsController

         def after_inactive_sign_up_path_for( resource)

         end

         def after_sign_up_path_for(resource)

         end

         end

Upvotes: 0

Views: 1323

Answers (1)

Zabba
Zabba

Reputation: 65517

As a start, you should be able to do this:

def after_sign_up_path_for(resource)
  show_home_path
end

See the devise wiki for a similar example

Upvotes: 1

Related Questions