How should I use https in Ruby on Rails

余生长醉 提交于 2020-01-05 06:08:35

问题


I'm developing an application in Rails (2.3.4) and there are some parts that need to run over a secure protocol, for example, the login form, the credit card form, etc.

  1. How can I do just these pages be https, and all other pages remain http?
  2. How can I test ssl in development environment?

回答1:


Configure apache to use SSL for the paths that require it (ie, '/login' etc.).

You'll also need to configure your routes to use https:

map.resources :login, :requirements => { :protocol => 'https' }



来源:https://stackoverflow.com/questions/1775688/how-should-i-use-https-in-ruby-on-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!