I have this code to generate a "unfollow" button via the 'link_to' function:
<%= link_to "Non seguire più", user_user_relationship_path(id:@relationship.id), remote: true, id: "follow_#{@user.id}", class:"btn btn-small btn-danger", method: :delete %>
I would like to know ho to use the "do..end" syntax with all those arguments.. Thanks!
You just skip the first parameter, can wrap the rest in parens, and then add the do/end.
<%= link_to(user_user_relationship_path(id:@relationship.id), remote: true, id: "follow_#{@user.id}", class:"btn btn-small btn-danger", method: :delete) do %>
<!-- your button html here -->
<% end %>
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