Change protocol to https in all rails helpers

后端 未结 9 1596
情书的邮戳
情书的邮戳 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:35

    If you are using Rails 4, defining ApplicationController#default_url_options doesn't work. URL options are now defined in the application's routes config:

    Rails.application.routes.draw do
      default_url_options protocol: :https
    end
    

提交回复
热议问题