Skip to content

Instantly share code, notes, and snippets.

@trey
Created February 4, 2012 20:22
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save trey/1739889 to your computer and use it in GitHub Desktop.
Save trey/1739889 to your computer and use it in GitHub Desktop.
Get Bootstrap's fancy Glyphicons working in Rails

Well, to get Bootstrap working, first install Less Rails Bootstrap.

Then create a button with a fancy icon like so:

<%= link_to raw('<i class="icon-trash icon-white"></i>'), card, confirm: 'Are you sure?', method: :delete, :class => 'btn btn-danger' %>

Note that you have to link to raw to get it to not escape the HTML.

Then you'll get something like this:

fancy delete button/icon

@andynu
Copy link

andynu commented Jul 3, 2012

Or you can use a block:

    = link_to card, confim: 'Are you sure?', method: :delete, class: 'btn btn-danger' do
      %i.icon-remove

via
http://mockra.com/post/18596035661/bootstrap-icons-as-links-in-rails

@trey
Copy link
Author

trey commented Dec 5, 2012

This is a Solutions Log post.

@originated
Copy link

Thanks Andynu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment