简体   繁体   中英

How should I use https in Ruby on Rails

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?

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' }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM