I am using simple_form gem with bootstrap 3. I want to have a wrapper for submit button
Now it shows HTML as
<form id="new_order" ...>
...
<input class="btn btn-primary" type="submit" value="Save" name="commit">
</form>
I want to write a wrapper so the HTML would be:
<form id="new_order" ...>
...
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input class="btn btn-primary" type="submit" value="Save" name="commit">
</div>
</div>
I got this so far:
app/initializers/simple_form_bootstrap.rb:
options[:wrapper] = :horizontal_form
options[:wrapper_mappings] = {
check_boxes: :horizontal_radio_and_checkboxes,
radio_buttons: :horizontal_radio_and_checkboxes,
file: :horizontal_file_input,
boolean: :horizontal_boolean,
# what to write here??
# submit: :horizontal_submit_button
}
and this is my wrapper:
config.wrappers :horizontal_submit_button, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.use :placeholder
b.wrapper tag: 'div', class: 'col-sm-offset-2 col-sm-10' do |ba|
ba.use :input
# some coe goes here, maybe
end
end
Which input type to use in wrapper_mappings for submit button? How to write that wrapper?
simple_form
. :( – Herzel