In the view helper add:
def wrapped_form(resource, options = {}, &block) options[:html] = { class: 'form-horizontal'} 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 } simple_form_for(resource, options, &block) end
And then you can just use it like this:
<%= wrapped_form @user_horizontal, url: create_horizontal_examples_url, as: 'user_horizontal' do |f| %> <%= f.error_notification %> <%= f.input :email, placeholder: 'Email' %> <% end %>
source share