0
我正在使用Rails和Devise進行用戶管理。 我希望我的所有電子郵件的風格一致,並修改設計密碼重置電子郵件。reset_password_instructions.html.erb使用什麼佈局
reset_password_instructions.html.erb
功能只有的內容。必須有某個地方使用的佈局,但我找不到它...
我正在使用Rails和Devise進行用戶管理。 我希望我的所有電子郵件的風格一致,並修改設計密碼重置電子郵件。reset_password_instructions.html.erb使用什麼佈局
reset_password_instructions.html.erb
功能只有的內容。必須有某個地方使用的佈局,但我找不到它...
您可以使用初始化程序爲所有Devise郵件定義佈局。
配置/初始化/ devise.rb
Devise.setup do |config|
# Other options here...
config.to_prepare do
Devise::Mailer.layout "email" # email.haml or email.erb
end
end
https://github.com/plataformatec/devise/wiki/How-To:-Create-custom-layouts
您必須創建與您Devise::Mailer.layout
確定名稱的新電子郵件的佈局,但這是一個很好的事情,因爲現在你可以完全控制在代碼上。