Rails 3 + devise: on after_inactive_sign_up_path_for () how to show an unverified user email address?

To have a page after registration, I added a RegistrationsController and a method to provide a custom page to let the user verify their email for an account confirmation link.

  def after_inactive_sign_up_path_for(resource)
    "/awaiting_confirmation"
  end

Is there any way on this page (which is seen by the user who created the account, but did not confirm it and have not signed it yet) to show the email address that they used to create the account.

I would like the page to say: "We just sent you a confirmation link to useremail@userdomain.com "

But the view of this page cannot display current_user.email because current_user is zero because they are not logged in.

Is there any other developer variable or session variable that will contain the newly created login information?

+3
source share
2 answers

that's how we solved it ... it was easy.

changed the single line controller method in my custom registration controller (see my question):

"/awaiting_confirmation?email=#{resource.email}"

then in the get method for route / awaiting_confirmation i just do

@email = params[:email]

and display the @email variable in my view.

+2
source

: - . , - :

:notice => "Email was sent to #{userobject.email}"

, .

, , - , , current_user. .

+1

All Articles