I am using Simple_form and Bootstrap.
I would like to use a horizontal wrapper, but I need to make the label wider and the input narrower. I would like to do this with bootstrap 4 vs custom css.
The label and input should be on the same line (inline), and right aligned.
col-md-8 for label and col-md-4 for input. How do I do that?
<%= f.input :role, :wrapper =>:horizontal_range, input_wrapper_html: { class: "col-md-4"}, label_wrapper_html: {class: "col-md-8"} %>
EDIT: I should add that the f.input :role is contained within a
<div class='row'>
<div class='col-md-6">
f.input :role
</div>
</div>
Second,
I need to add a % at the end of my input. However, it does not seem to work.
<%= f.input :pct_of_car , append: "%", :wrapper =>:horizontal_range %>
However, this does not seem to work. What is wrong with my syntax?
Third, how would one modify the vertical collection_inline to have 2 or 3 columns?
# vertical input for inline radio buttons and check boxes
config.wrappers :bs_vertical_collection_inline, item_wrapper_class: 'form-check form-check-inline', tag: 'fieldset', class: 'form-group', error_class: 'form-group-invalid', valid_class: 'form-group-valid' do |b|
b.use :html5
b.optional :readonly
b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba|
ba.use :label_text
end
b.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid'
b.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback d-block' }
b.use :hint, wrap_with: { tag: 'small', class: 'form-text text-muted' }
end
Currently all the checkboxes are listed inline and have no structure. I need to list the choices in 2 or 3 columns so that they are easier to read. This is also a long list, so may need to wrap the choices in a scroll box.