Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple helper for Twitter Bootstrap stuff
module BootstrapHelper
def icon_tag icon, opts = {}
defaults = {
white: false,
large: false
}
defaults.merge(opts)
class_string = "icon-#{icon.to_s}"
class_string = "#{class_string} icon-white" if defaults[:white]
class_string = "#{class_string} icon-large" if defaults[:large]
content_tag(:i, '', class: class_string)
end
def caret_tag
content_tag(:b, '', class: 'caret')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment