How do I include a class in link_to remote?

I have this code and I want to enable glyphicon, but the code below is not working. If I remove the class subcomment_link

it works, but I really need to include it for jquery

. What is the correct syntax for link_to

having removed with the specified class?

<%= link_to new_subcomment_path(:response_id => response.id), class: "subcomment_link", id: "reply_new_subcomment#{response.id}", remote: true do %> 
    <i class="glyphicon glyphicon-pencil"></i>&nbsp Edit your profile 
<% end %>

      

+3


source to share


1 answer


Try changing it to:

<%= link_to new_subcomment_path(:response_id => response.id), {remote: true}, {class: "subcomment_link", id: "reply_new_subcomment#{response.id}"} do %>

      



Typically tag parameters appear before html parameters.

+2


source







All Articles