开发者

Rails 3 SSL Protocol links

开发者 https://www.devze.com 2023-01-27 10:03 出处:网络
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\

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

0

精彩评论

暂无评论...
验证码 换一张
取 消