Module: Bootstrap::ViewHelpers::BadgeHelper

Defined in:
app/helpers/bootstrap/view_helpers/badge_helper.rb

Instance Method Summary collapse

Instance Method Details

#bs_badge(label_or_options = {}, options = {}, &block) ⇒ Object



4
5
6
7
8
# File 'app/helpers/bootstrap/view_helpers/badge_helper.rb', line 4

def bs_badge(label_or_options = {}, options = {}, &block)
  options = label_or_options if block_given?
  options[:label] = label_or_options unless block_given?
  Components::Badge.new(self, options, &block).to_html
end

#bs_pill(label_or_options = {}, options = {}, &block) ⇒ Object



10
11
12
13
14
15
# File 'app/helpers/bootstrap/view_helpers/badge_helper.rb', line 10

def bs_pill(label_or_options = {}, options = {}, &block)
  options = label_or_options if block_given?
  options[:label] = label_or_options unless block_given?
  options[:pill] = true
  Components::Badge.new(self, options, &block).to_html
end