iand675
iand675

Reputation: 1118

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

Upvotes: 2

Views: 3265

Answers (1)

Fábio Batista
Fábio Batista

Reputation: 25270

See this:

Rails 3 SSL Deprecation

Upvotes: 1

Related Questions