Module: BootstrapForm::Helpers::Bootstrap4
- Defined in:
- lib/bootstrap_form/helpers/bootstrap4.rb
Instance Method Summary collapse
-
#prepend_and_append_input(name, options, &block) ⇒ Object
TODO check upstream - append tag options.
- #submit(name = nil, options = {}) ⇒ Object
Instance Method Details
#prepend_and_append_input(name, options, &block) ⇒ Object
TODO check upstream - append tag options
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bootstrap_form/helpers/bootstrap4.rb', line 12 def prepend_and_append_input(name, , &block) = .extract!(:prepend, :append, :input_group_class, :append_tag, :input_group) input_group_class = ["input-group", [:input_group_class]].compact.join(' ') input = capture(&block) || "".html_safe input = content_tag(:div, input_group_content([:prepend]), class: 'input-group-prepend') + input if [:prepend] input << content_tag(:div, input_group_content([:append]), ([:append_tag] || {}).merge(class: 'input-group-append')) if [:append] input << generate_error(name) input = content_tag(:div, input, ([:input_group] || {}).merge(class: input_group_class)) unless .empty? input end |
#submit(name = nil, options = {}) ⇒ Object
5 6 7 8 |
# File 'lib/bootstrap_form/helpers/bootstrap4.rb', line 5 def submit(name = nil, = {}) .reverse_merge! class: 'btn btn-secondary' super(name, ) end |