Related: Rails 3 forwarding SSL routing from https to http (unfortunately, it does not work).
Duplicate, but the answer didnโt work for me: ssl setup during development
I have a web application that has been working fine for a while, but I need to add SSL in the acct login / edit path. I use Devise for authentication. I found a wiki entry that made the process pretty simple, but hell if I could get it to work. The simple part was as follows:
#in config/environments/production.rb config.to_prepare { Devise::SessionsController.force_ssl } config.to_prepare { Devise::RegistrationsController.force_ssl }
And then this value contains about 25 lines of code: https://gist.github.com/1040964
I got this to work well enough, but when I exit, I get 301 from the DELETE session, which sends me to GET.
Started DELETE "/users/sign_out" for 98.246.164.160 at 2012-03-02 01:45:42 +0000 [02 Mar 01:45 10886 INFO] Processing by Devise::SessionsController#destroy as HTML [02 Mar 01:45 10886 INFO] Parameters: {"authenticity_token"=>"fI4VZ4V0Go2Civo3sJz8Dv5/Wtaa90ynaYr+xxx="} [02 Mar 01:45 10886 DEBUG] Parameters: {"_method"=>"delete", "authenticity_token"=>"fI4VZ4V0Go2Civo3sJz8Dv5/Wtaa90ynaYr+xxxx=", "action"=>"destroy", "controller"=>"devise/sessions"} [02 Mar 01:45 10886 INFO] Redirected to https:
So, I think I need to start from scratch. What is the easiest way to make any development path using https, but the rest of the paths in my application use http? I tried this (from the SO post at the top):
#devise routes scope :protocol => 'https://', :constraints => { :protocol => 'https://' } do devise_for :users, :controllers => { :registrations => :registrations } devise_for :admins end
But donโt leave. I need a better offer.
jcollum
source share