Module: BootstrapFormExtensions::Helpers
- Included in:
- ArrayedField, DateTimePickers, Duration, Scheduler, Scheduler::Serializer, SelectOrNew, Timespan
- Defined in:
- lib/bootstrap_form_extensions/helpers.rb
Instance Method Summary collapse
Instance Method Details
#glyphicon_tag(*icons) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/bootstrap_form_extensions/helpers.rb', line 5 def glyphicon_tag *icons = icons. [:class] = .fetch :class, '' [:class] << " glyphicon " << icons.flatten.map{ |icon| "glyphicon-#{icon}"}.join(' ') content_tag :i, nil, end |
#merge_css_classes(*css) ⇒ Object
16 17 18 |
# File 'lib/bootstrap_form_extensions/helpers.rb', line 16 def merge_css_classes *css css.map { |value| value.to_s.split ' ' }.flatten.compact.uniq.join(' ') end |
#true?(value) ⇒ Boolean
12 13 14 |
# File 'lib/bootstrap_form_extensions/helpers.rb', line 12 def true? value value.to_s.match(/(true|t|yes|y|1)$/i).present? end |