Skip to content

Instantly share code, notes, and snippets.

@pubis
Created March 9, 2012 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pubis/2005891 to your computer and use it in GitHub Desktop.
Save pubis/2005891 to your computer and use it in GitHub Desktop.
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