title: Ruby On Rails : Devise : Get email from 'resource.reset_password_token' in `Change your password` template
body: <p><code>Scenario</code>: Show email in landing page when you click on password reset link<br>
  <code>Given</code> I am a user and I clicked on the password reset link inside my email<br>
  <code>Then</code> I am redirected to 'Change Password' page<br>
  <code>And</code> I see two password fields </p>
  
  <p><code>Expected</code> I also see the email of the user whose password is to be reset  </p>
  
  <p><code>Problem</code>: How to get the email from only the <code>:reset_password_token</code> value?</p>
  
  <p>Output from console when I <code>binding.pry</code> in the view <code>/views/devise/passwords/edit.html.erb</code></p>
  
  <pre><code>[1] pry(#&lt;#&lt;Class:0x007fd4ec6f65f8&gt;&gt;)&gt; resource
  =&gt; #&lt;User id: nil, email: "", encrypted_password: "", reset_password_token: "Ba-9txxmmUMkU_xywypz", reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 0, current_sign_in_at: nil, last_sign_in_at: nil, current_sign_in_ip: nil, last_sign_in_ip: nil, created_at: nil, updated_at: nil, first_name: nil, last_name: nil, customer_admin_id: nil, admin_id: nil, confirmation_token: nil, confirmed_at: nil, confirmation_sent_at: nil, organization_id: nil, status: nil, middle_name: nil, type: nil, cell_number: nil, phone_number: nil, extension: nil&gt;
  </code></pre>
  
  <p>also When I invoke <code>User.find(5)</code> I see</p>
  
  <pre><code> #&lt;User id: 5, email: "recruiter_one+org_one@mysite.com", encrypted_password: "$2a$10$v7gYTdfoIZ9yCVIx3Xb5lOYVPly71NHtOc1mbWuHxZvt...", reset_password_token: "095a18fc2455c39e4838c322e3124d0052cf2cc0e86b7fe3486...", reset_password_sent_at: "2015-06-29 10:01:56", remember_created_at: nil, sign_in_count: 10, current_sign_in_at: "2015-06-29 10:01:04", last_sign_in_at: "2015-06-29 09:35:56", current_sign_in_ip: "192.164.79.122", last_sign_in_ip: "192.164.79.122", created_at: "2015-06-12 05:06:50", updated_at: "2015-06-29 10:01:56", first_name: "Rec One Loc One", last_name: "Peter", customer_admin_id: nil, admin_id: nil, confirmation_token: nil, confirmed_at: "2015-06-12 05:13:49", confirmation_sent_at: "2015-06-12 05:06:50", organization_id: 3, status: "active", middle_name: "", type: nil, cell_number: "", phone_number: "1231232131", extension: ""&gt;
  </code></pre>
  
  <p>That is:</p>
  
  <pre><code>[4] pry(#&lt;#&lt;Class:0x007fd4ec6f65f8&gt;&gt;)&gt; User.find(5).reset_password_token
    CACHE (0.0ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` = 5 LIMIT 1  [["id", 5]]
  =&gt; "095a18fc2455c39e4838c322e3124d0052cf2cc0e86b7fe3486f72a67c5a5315"
  [5] pry(#&lt;#&lt;Class:0x007fd4ec6f65f8&gt;&gt;)&gt; 
  </code></pre>
  
  <p><code>095a18fc2455c39e4838c322e3124d0052cf2cc0e86b7fe3486f72a67c5a5315</code> from database does not match with <code>Ba-9txxmmUMkU_xywypz</code> I get from <code>resource</code></p>
  
  <p>PS: I use <code>devise (3.2.4)</code></p>