Module: Bootstrap::StampHelper
- Defined in:
- app/helpers/bootstrap/stamp_helper.rb
Overview
Rails helper for producing Twitter Bootstrap labels. We use #stamp() because #label() is a standard Rails helper method.
See: twitter.github.io/bootstrap/components.html#labels-badges
Constant Summary collapse
- InvalidStampTypeError =
Class.new(StandardError)
- LABEL_TYPES =
%w(default primary success info warning danger)
Instance Method Summary collapse
-
#stamp(*args) ⇒ String
Returns a Bootstrap label.
Instance Method Details
#stamp(text, options = {}) ⇒ String #stamp(text, type, options = {}) ⇒ String
Returns a Bootstrap label
30 31 32 33 34 |
# File 'app/helpers/bootstrap/stamp_helper.rb', line 30 def stamp(*args) text = args.shift = add_label_classes(*args) content_tag(:span, text, ) end |