You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys!
First of all thanks for the great gem, it makes development process much easier and faster! 👍
By the way, I've faced strange behavior recently and believe that it is a bug. Let me describe it.
I am using simple_form for foundation via rails generate simple_form:install --foundation.
The documentation says :
If you want to have all other HTML 5 features, such as the new field types, you can disable only the browser validation:
SimpleForm.browser_validations = false # default is true
But if we check it, than we see that SimpleForm.browser_validations = false by default, not true
And I suspect the problem is in the generator for simple_forinstallation install_generator.rb
It generates both files simple_form.rb and simple_form_foundation.rb (or bootstrap) even we chose only for Foundation.
Then Rails is loading initializers in alphabetical order, so browser_validations became false because of initializers/simple_form.rb and then this option used it foundation initializer because there is not override there.
So few questions:
should the browser_validations be set to true in initializers/simple_form.rb (and both foundation and bootstrap initializers) ? - this is according to the README. Or update the README appropriately.
what is the reason for generating initializers/simple_form.rb when we installing simple_form for Foundation/Bootstrap? Maybe it's fine to not doing it and duplicate common options in each initializer if any?
Want I send an PR ? 😊
The text was updated successfully, but these errors were encountered:
Hi guys!
First of all thanks for the great gem, it makes development process much easier and faster! 👍
By the way, I've faced strange behavior recently and believe that it is a bug. Let me describe it.
I am using simple_form for foundation via
rails generate simple_form:install --foundation
.The documentation says :
But if we check it, than we see that
SimpleForm.browser_validations = false
by default, not trueI found only two places where it could be changed:
initializers/simple_form.rb
and
lib/simple_form.rb
And I suspect the problem is in the generator for
simple_for
installationinstall_generator.rb
It generates both files
simple_form.rb
andsimple_form_foundation.rb
(or bootstrap) even we chose only for Foundation.Then Rails is loading initializers in alphabetical order, so browser_validations became false because of
initializers/simple_form.rb
and then this option used it foundation initializer because there is not override there.So few questions:
browser_validations
be set to true ininitializers/simple_form.rb
(and both foundation and bootstrap initializers) ? - this is according to the README. Or update the README appropriately.initializers/simple_form.rb
when we installingsimple_form
for Foundation/Bootstrap? Maybe it's fine to not doing it and duplicate common options in each initializer if any?The text was updated successfully, but these errors were encountered: