Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 982
Mateusz Urbański Avatar asked Oct 27 '25 14:10

Mateusz Urbański


1 Answers

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.

like image 53
Bartosz Pietraszko Avatar answered Oct 29 '25 06:10

Bartosz Pietraszko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!