rails/rails — Issue #3571: <route>_url helpers should know if they should be using https or http
Author: joevandyk
Created: 2011-11-08 20:15:21+00:00
State: open

If I specify in my routes that a given URL should be using https, then using the _url route helper should output a https url.

Example:

scope :constraints => { :protocol => "https" } do
match '/login' => 'controller#action', :as => 'login'
end

match '/' => 'welcome#index', :as => 'index'

login_url should output https://domain.com/login

index_url should output http://domain.com/