Module: BootstrapFormExtensions::Helpers

Included in:
ArrayedField, Duration, Scheduler, Scheduler::Serializer, SelectOrNew, Timespan
Defined in:
lib/bootstrap_form_extensions/helpers.rb

Instance Method Summary collapse

Instance Method Details

#merge_css_classes(*css) ⇒ Object



9
10
11
# File 'lib/bootstrap_form_extensions/helpers.rb', line 9

def merge_css_classes *css
  css.map { |value| value.to_s.split ' ' }.flatten.compact.uniq.join(' ')
end

#true?(value) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/bootstrap_form_extensions/helpers.rb', line 5

def true? value
  value.to_s.match(/(true|t|yes|y|1)$/i).present?
end