Mateusz Urbański
Mateusz Urbański

Reputation: 7862

SimpleForm remove wrapper divs

I'm using SimpleForm in my Ruby on Rails app. To make my input look good with my current css I need to disable wrapper every time for the input:

f.input :email, wrapper: false, input_html: { class: 'input' }

How can I remove this wrapper globally?

Upvotes: 4

Views: 2172

Answers (1)

Bartosz Pietraszko
Bartosz Pietraszko

Reputation: 1407

If by "globally" you mean all forms in application, then I don't think it can be done through standard configuration in config/initializers/simple_form.rb. However, you can easily disable wrappers in a form by setting defaults for all inputs in it:

<%= simple_form_for @user, defaults: { wrapper: false } do |f| %>

Please remember that wrappers in simple_form are highly configurable and controlling classes for them is possible with options available in initializer.

Upvotes: 4

Related Questions