Module: Shoehorn::Helpers::BadgeHelpers
- Defined in:
- lib/shoehorn/helpers/badge_helpers.rb
Instance Method Summary collapse
-
#bootstrap_badge(message, options = {}) ⇒ Object
Renders badge.
Instance Method Details
#bootstrap_badge(message, options = {}) ⇒ Object
Renders badge
Examples
bootstrap_badge("Hello!")
# => '<span class="badge">Hello!</span>'
bootstrap_badge("Hello!", type: 'success')
# => '<span class="badge badge-success">Hello!</span>'
bootstrap_badge("Hello!", type: 'warning', class: "my_awesome_class")
# => '<span class="my_awesome_class badge badge-warning">Hello!</span>'
bootstrap_badge("Hello!", type: 'info', bootstrap_class_prefix: "my_badge")
# => '<span class="my_badge my_badge-warning">Hello!</span>'
Returns HTML String for the badge
29 30 31 32 33 34 |
# File 'lib/shoehorn/helpers/badge_helpers.rb', line 29 def bootstrap_badge(, = {}) Shoehorn::Components::Badge.new( , ).to_s end |