0

The Rails docs for devise say that the instructions for how to redirect are incorrect:

https://github.com/plataformatec/devise/wiki/How-To:-Add-:confirmable-to-Users#redirecting-user

Does anyone know how to do this?

Mel
  • 2,481
  • 26
  • 113
  • 273

1 Answers1

1

you will need to override devise confirmation controller. in your routes.rb add this line

devise_for :users, controllers: { confirmations: 'confirmations' }

create file in and paste this code

class ConfirmationsController < Devise::ConfirmationsController

  private

  def after_confirmation_path_for(resource_name, resource)
    your_new_after_confirmation_path #your path where you want to land
  end

end

you may also need to restart the server.

Source : https://github.com/plataformatec/devise/wiki/How-To:-Add-:confirmable-to-Users#redirecting-user

Jean
  • 825
  • 8
  • 17
Asnad Atta
  • 3,855
  • 1
  • 32
  • 49