下面的内容有效,但我可以为它添加一个课程。
<%= link_to "Cancel My Subscription", {:controller => :charges, :action => :cancel}, {:method => :post } %>
这不起作用:
<%= link_to "Cancel My Subscription", {:controller => :charges, :action => :cancel}, {:method => :post }, :class => "btn" %>
答案 0 :(得分:2)
向链接添加类的方法如下:
<%= link_to "Cancel My Subscription", { URL_FOR PARAMS HERE }, :controller =>
:charges, :action => :cancel, :method => :post, :class => "btn" %>
希望这有帮助。