Sha256: a214d077ad5772252df616553762bb5984f0d4d09fde3a27f05c85d77903224f

Contents?: true

Size: 714 Bytes

Versions: 9

Compression:

Stored size: 714 Bytes

Contents

# Helper methods for Bootstrap icons.
#
# See: http://twitter.github.io/bootstrap/base-css.html#icons
#
# @example Icons
#   icon(:search)
#   icon(:search, :white)
#   icon(:search, :white, id: 'my-id')
#
# @example Icons with text
#   icon(:search, 'Search')
#   icon(:remove, :white, 'Delete')
#   icon(:ok, 'Save', id: 'my-id')
#
# @example Text without icon
#   # so text lines up when you have text but no icon
#   icon(:blank, 'No icon')
module Bootstrap::IconHelper
  
  # Returns a Bootstrap icon glyph.
  #
  # Optionally returns text with icon.
  # 
  # See class documentation (above) for examples.
  # @return [String]
  def icon(*args)
    ::Bootstrap::IconRenderer.new(self, *args).html
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bootstrap-view-helpers-0.0.14 app/helpers/bootstrap/icon_helper.rb
bootstrap-view-helpers-0.0.13 app/helpers/bootstrap/icon_helper.rb
bootstrap-view-helpers-0.0.12 app/helpers/bootstrap/icon_helper.rb
bootstrap-view-helpers-0.0.11 app/helpers/bootstrap/icon_helper.rb
bootstrap-view-helpers-0.0.10 app/helpers/bootstrap/icon_helper.rb
bootstrap-view-helpers-0.0.9 app/helpers/bootstrap/icon_helper.rb
bootstrap-view-helpers-0.0.8 app/helpers/bootstrap/icon_helper.rb
bootstrap-view-helpers-0.0.7 app/helpers/bootstrap/icon_helper.rb
bootstrap-view-helpers-0.0.6 app/helpers/bootstrap/icon_helper.rb