Getting Rails URL helpers to automatically output https urls

后端 未结 7 2051
再見小時候
再見小時候 2020-12-25 12:02

I am developing a site that mixes http and https a lot - whats the best/easiest way to make the links use the right protocol for the route - can it be specified in the route

7条回答
  •  时光说笑
    2020-12-25 12:47

    You can use a plugin called ss_requirement, it will provide you with methods like ssl_required ssl_allowed

    You can simply add this in your controller to enable ot disable https on any action

    ssl_allowed :login, :update_profile
    

    https://github.com/rails/ssl_requirement

提交回复
热议问题