Donnerstag, 1. August 2013

Remember Me & Reset Password

In http://disaster-assistance.blogspot.com/2013/07/how-i-test.html, I followed the railscast http://railscasts.com/episodes/275-how-i-test.  Although I passed every test, my project_learning_app wasn't able to send a mail.

To solve the problem, instead of test environment, I used the development environment. So I used the following configuration in config/environments/development.rb, and it worked:

  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.default_url_options = { host: "localhost:3000" }
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    address:              'smtp.gmail.com',
    port:                 587,
    domain:               'localhost:3000',
    user_name:          'user@gmail.com',
    password:             'password',
    authentication:       'plain',
    enable_starttls_auto: true  }

But, I had an error because I should complete the edit and update method of password_resets_controller.rb, so I followed another railscast: http://railscasts.com/episodes/274-remember-me-reset-password?view=asciicast
This railscast was interesting:
- First, the railscast use form_for and I use simple_for, so for the check_box in simpleform, I used:
<%= f.input :remember_me, as: :boolean, input_html: { checked: true } %>

- At the moment, I obtain the following error when I try to change the password:
No route matches [PUT] "/password_resets.tyubOZQQExHjqqOSfMRqAw"

Well, I'll continue with this interesting question another day.

Have a good weekend!!!





Keine Kommentare:

Kommentar veröffentlichen