Rails 4.1 Mailer Previews and Devise custom emails

后端 未结 4 1243
星月不相逢
星月不相逢 2020-12-29 19:43

I have a brand new Rails 4.1.1 app where I\'m customizing the Devise emails. I want to have them displayed on the new Rails email preview feature so I did the following:

4条回答
  •  粉色の甜心
    2020-12-29 20:04

    You will get undefined method for the devise url helpers when you have forgotten to include the necessary devise modules in your model. e.g. if your model is User and you want the confirmation_url, you must ensure that the :confirmable module is included:

    devise <...snipped...>, :confirmable
    

    Be aware that if this module is not currently loaded that your application most likely does not use e.g. confirmations!

    Including the :confirmable module might then lock out all your users. See https://github.com/plataformatec/devise/wiki/How-To:-Add-:confirmable-to-Users

提交回复
热议问题