-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<route>_url helpers should know if they should be using https or http #3571
Comments
I agree with you on the |
I saw the solution in the stackoverflow ticket, but it involved overriding url_for in multiple places, which seems hacky. Maybe if you constrain |
From what I can see, this is what the Stack Overflow ticket is suggesting: # routes.rb
scope :protocol => 'https://', :constraints => { :protocol => 'https://' } do
resources :sessions
end
resources :gizmos So no |
I can't seem to get those routes to work though, using the above routes file, when I use
It (of course) works when I remove the scope from around the |
@joevandyk any news in this? @tenderlove @josevalim |
I think it's still a problem. Would love to have it fixed. |
Do you have time to work on a patch? |
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:
login_url
should outputhttps://domain.com/login
, even if I'm on a http page.index_url
should outputhttp://domain.com/
, even if I'm on a https page.See http://stackoverflow.com/questions/3993651/rails-3-ssl-routing-redirects-from-https-to-http and http://stackoverflow.com/questions/6699881/getting-rails-url-helpers-to-automatically-output-https-urls for a discussion of this issue.
The text was updated successfully, but these errors were encountered: