link_to with :protocol isn't working

后端 未结 2 1140
面向向阳花
面向向阳花 2021-02-13 07:12

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 => \         


        
2条回答
  •  感情败类
    2021-02-13 08:02

    You must put the :protocol option inside the path helper:

    <%= link_to "Buy now!", line_items_url(:thing_id => @thing, :protocol => "https"), :method => :post %>
    

提交回复
热议问题