I want to have a link use SSL. I'm using this code:
<%= link_to "Buy now!", line_items_path(:thing_id => @thing), :method => :post, :protocol => "https", :only_path => false %>
For some reason, the link is being generated with http://
instead of https://
.
I'm using Rails 3.0.3.
You must put the :protocol option inside the path helper:
<%= link_to "Buy now!", line_items_url(:thing_id => @thing, :protocol => "https"), :method => :post %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With