This was super annoying so i decided to write it down.
I needed to add some data attributes to a simple_form input(f.input :people, as: :select
) and also maintain the bootstrap classes
Here's how i solved it:
<%= f.input :car_id, label: 'Select a Car' do %>
<%= f.select :car_id, @cars.map { |car| [car.name, car.id, {'data-car-price' => car.current_price}] }, {include_blank: true}, {class: 'form-control'} %>
<% end %>
The magic happens with the regular rails f.select :blah, :yada, nil...
but you keep your simple_form styles when you wrap it with a simple_form input block.
i could not get the rails select block to work with the content_tag as written here: http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#method-i-select
thank you!