Search code examples
ruby-on-railsrubyruby-on-rails-3rubygemsruby-on-rails-plugins

How do I easily set devise in ruby on rails 3 to email forgotten password information?


Is there a quick way to do this? I've never used mail in rails before. Isn't this all set up in devise leaving me a small modification to make to make it work?

Thanks in advance


Solution

  • In your user model, you need a devise call to tell devise what facets of it you want to use. As long as it includes :recoverable, devise itself includes all the views and logic to make this work (except actually sending the mail - you need to configure your mail server yourself).

    class User < ActiveRecord::Base
      devise :database_authenticatable, :registerable, :confirmable, :recoverable
    end