Multiple inputs on a single line with Twitter Bootstrap and Simple Form 2.0
- by noel_g
I am using simple_form 2.0 with twitter bootstrap.
I am trying to determine what is the proper wrapper format in order to get something like
[city] [State] [Zip]
I believe my form needs to be
<div class="control-group">
<%= f.input :city,:wrapper => :small, :placeholder => "City", :input_html => { :class=>"span2", :maxlength => 10},:label => false %>
<%= f.input :region, :wrapper => :small , :placeholder => "Region", :input_html => { :class=>"span1", :maxlength => 5}, :label => false %>
<%= f.input :postal_code, :wrapper => :small, :placeholder => "Postal Code",:input_html => { :class=>"span2", :maxlength => 10},:label => false %>
</div>
I tried this wrapper
config.wrappers :small, :tag => 'div', :class => 'controls inline-inputs', :error_class => 'error' do |b|
b.use :placeholder
b.use :label_input
end
I believe I would need to define the CSS as well, but before I go down a rabbit hole I thought I would ask if this is built in somewhere.