Module: BootstrapFormExtensions::Duration
- Includes:
- Helpers
- Defined in:
- lib/bootstrap_form_extensions/duration.rb
Instance Method Summary
collapse
Methods included from Helpers
#merge_css_classes, #true?
Instance Method Details
#duration(method, **options) ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/bootstrap_form_extensions/duration.rb', line 18
def duration method, **options
options[:class] = merge_css_classes options[:class], 'form-control'
fields = duration_fields_builder method, options.except(:wrapper, :wrapper_class)
options[:control_col] = control_col_for_number_fields options
options[:wrapper_class] = merge_css_classes options[:wrapper_class], 'duration-group'
options[:wrapper] ||= {}
options[:wrapper][:data] ||= {}
options[:wrapper][:data][:duration] = true
form_group_builder(method, options) { fields }
end
|
#duration_without_bootstrap(method, **options) ⇒ Object
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/bootstrap_form_extensions/duration.rb', line 7
def duration_without_bootstrap method, **options
fields = duration_fields_builder method, options.except(:wrapper, :wrapper_class)
options[:class] = merge_css_classes options.delete(:wrapper_class), 'duration-group'
options.merge!(options.delete(:wrapper) { {} })
options[:data] ||= {}
options[:data][:duration] = true
content_tag :div, fields, options
end
|