在Devise 1.51的Rails 3.1.1應用程序中,我希望確認消息中使用的確認鏈接是https而不是http。所以在一封電子郵件中 「確認鏈接」 將指向類似:更改設計確認鏈接以使用https
https://mysite.com/users/confirmation?confirmation_token=
我嘗試添加:
config.to_prepare { Devise::SessionsController.force_ssl }
config.to_prepare { Devise::RegistrationsController.force_ssl }
config.to_prepare { Devise::ConfirmationsController.force_ssl }
到配置/環境/ production.rb
,但它確實沒有幫助。有誰知道這樣做的正確方法?我知道我可以進入視圖:devise/mailer/confirmation_instructions.html.erb
並替換confirmation_url(),但是我想知道是否有更好的方法來確保所有內容都是https(即使我知道有一個性能命中)非常感謝。