Change protocol to https in all rails helpers

后端 未结 9 1621
情书的邮戳
情书的邮戳 2020-12-10 12:55

Rails 3.1+ I want my url helpers to use the https protocol without having to specify it in every helper I call. After searching around I\'ve found various ways but none work

9条回答
  •  没有蜡笔的小新
    2020-12-10 13:37

    I tried all answers above, only this works for me:

    config/environments/production.rb

    Rails.application.routes.default_url_options[:protocol] = 'https'
    

    ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-linux] Rails 3.2.22.5

提交回复
热议问题