Clean way to use Bootstrap's Icon glyphs in Rails
I used to do this a lot:
<%= link_to '#', :class => "btn btn-danger" do %>
<i class="icon-remove"></i>
<% end %>
but if you're using the twitter-bootstrap-rails gem on master branch, you can do it in a cleaner way
<%= link_to glyph(:remove), '#', :class => "btn btn-danger" %>
Written by Alan Ho
Related protips
1 Response
Very helpful. Can you clarify what you mean by "on master branch"?
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#