heartcombo / simple_form

Forms made easy for Rails! It's tied to a simple DSL, with no opinion on markup.
http://blog.plataformatec.com.br/tag/simple_form
MIT License
8.22k stars 1.32k forks source link

Honor `include_hidden` on inline boolean inputs #1772

Closed yboulkaid closed 2 years ago

yboulkaid commented 2 years ago

On nested-style boolean inputs, it's possible to opt-out of the hidden input generation by passing the include_hidden: false option.

However, for inline inputs, this still generates the hidden field, causing an inconsistency between the two boolean styles, and a whole lot of late night confusion.

A workaround has been proposed in a comment from 2016, which consists in passing include_hidden in the input_html. I think this is not ideal, as it causes inconsitencies between the APIs of the boolean styles.

This PR makes the inline checkboxes honor the include_hidden styles, making their API consistent.

nashby commented 2 years ago

@yboulkaid totally makes sense, thanks!