I've been looking everywhere for a good explanation of how to add glyphicons to rails link_to
and button_to
helpers, but I've found very little. What I've gathered so far has led me to this:
<li> <%= link_to deals_path, class: "btn btn-default" do %> <%= content_tag(:i, "Dasboard",:class=>' glyphicon, glyphicon-th-large') -%> <% end %> </li>
This doesn't work though and I think the one example I found was from Bootstrap 2. Can anyone point me to a good resource on this, or provide a quick example? Thanks in advance!
I found the answer to this here
The basic form of a glyph link in rails looks like this:
<%= link_to deals_path, class: "btn btn-default" do %> <i class="glyphicon glyphicon-euro"></i> Dashboard <% end %>
Modify as needed. The second example in that link didn't work for me, I assume because I'm using the rails_bootstrap_sass gem? Regardless, the above form worked for me.
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