Skip to content

Instantly share code, notes, and snippets.

View patricklewis's full-sized avatar

Patrick Lewis patricklewis

View GitHub Profile
@trey
trey / gist:1739889
Created February 4, 2012 20:22
Get Bootstrap's fancy Glyphicons working in Rails

Well, to get Bootstrap working, first install [Less Rails Bootstrap][lrb].

Then create a button with a [fancy icon][fi] 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.