Module: Bootstrap::BadgeHelper
- Defined in:
- app/helpers/bootstrap/badge_helper.rb
Overview
Rails helper for producing Twitter Bootstrap badges
See: twitter.github.io/bootstrap/components.html#labels-badges
Default badge:
Constant Summary collapse
- InvalidBadgeTypeError =
Class.new(StandardError)
- BADGE_TYPES =
%w(default primary success info warning danger)
Instance Method Summary collapse
-
#badge(*args) ⇒ String
Returns html for a Bootstrap badge.
Instance Method Details
#badge(text, options = {}) ⇒ String #badge(text, badge_type, options = {}) ⇒ String
Returns html for a Bootstrap badge.
32 33 34 35 36 |
# File 'app/helpers/bootstrap/badge_helper.rb', line 32 def badge(*args) text = args.shift = add_badge_classes(*args) content_tag(:span, text, ) end |