i want to use the new Icon tag from bootstrap css to make a remote call in rails 3.1.1
Here is my original code:
<%=link_to(image_tag("/assets/icons/sub_blue_down.png", :class => "points_arrow"),
vote_down_politician_path(pending_discussions, :politician_id =>
pending_discussions.politician_id), :remote=> true, :method => :post) %>
I want to use this:
<i class="icon-minus-sign"></i>
Instead of the image tag
Here is my attempt but doesn't work:
<%= link_to ' <i class="icon-plus-sign"></i>',
vote_up_politician_path(pending_discussions, :politician_id =>
pending_discussions.politician_id), :remote=> true, :method => :post%>
You should be using this syntax instead:
<%= link_to vote_up_politician_path(pending_discussions, :politician_id =>
pending_discussions.politician_id), :remote=> true, :method => :post do%>
<i class="icon-plus-sign"></i>
<% end %>
More info: http://apidock.com/rails/ActionView/Helpers/UrlHelper/link_to
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