Fill in email on the new password form

This commit is contained in:
Vinnie Okada 2015-05-13 21:57:16 -06:00
parent c68c23210b
commit af428b1259
4 changed files with 4 additions and 4 deletions

View file

@ -52,7 +52,7 @@ class PasswordsController < Devise::PasswordsController
unless user.reset_password_period_valid?
flash[:alert] = 'Your password reset token has expired.'
redirect_to(new_user_password_url)
redirect_to(new_user_password_url(user_email: user['email']))
end
end
end

View file

@ -50,7 +50,7 @@ module EmailsHelper
end
def reset_token_expire_message
link_tag = link_to('request a new one', new_user_password_url)
link_tag = link_to('request a new one', new_user_password_url(user_email: @user.email))
msg = "This link is valid for #{password_reset_token_valid_time}. "
msg << "After it expires, you can #{link_tag}."
end

View file

@ -6,7 +6,7 @@
.devise-errors
= devise_error_messages!
.clearfix.append-bottom-20
= f.email_field :email, placeholder: "Email", class: "form-control", required: true
= f.email_field :email, placeholder: "Email", class: "form-control", required: true, value: params[:user_email]
.clearfix
= f.submit "Reset password", class: "btn-primary btn"

View file

@ -11,6 +11,6 @@
- if @user.created_by_id
%p
= link_to "Click here to set your password", edit_password_url(@user, :reset_password_token => @token)
= link_to "Click here to set your password", edit_password_url(@user, reset_password_token: @token)
%p
= reset_token_expire_message