Rails 3 SSL Protocol links
I'm trying to开发者_开发问答 create a link to a page that requires ssl, and the routes are properly set up to require it to be https, but I can't figure out how to get link_to to behave properly. I've tried writing it like this, but when I click on the link it still tries to go to an http page, not the https page like I'd expect. Am I doing something wrong?
link_to "Schedule a Visit!", :controller => 'visits',
:action => 'new',
:protocol => "https"
For reference, this is the appropriate part in my routes.rb:
scope :constraints => {:protocol => "https"} do
resources :visits, :only => [:new, :create]
end
See this:
Rails 3 SSL Deprecation
精彩评论