Reputation: 51
The below works, but I'd lie to add a class to it.
<%= link_to "Cancel My Subscription", {:controller => :charges, :action => :cancel}, {:method => :post } %>
This is not working:
<%= link_to "Cancel My Subscription", {:controller => :charges, :action => :cancel}, {:method => :post }, :class => "btn" %>
Upvotes: 1
Views: 182
Reputation: 4593
The way to add a class to a link is as follows:
<%= link_to "Cancel My Subscription", { URL_FOR PARAMS HERE }, :controller =>
:charges, :action => :cancel, :method => :post, :class => "btn" %>
Hope this helps.
Upvotes: 2