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
All config regarding how to render the forms are stored on the SimpleForm module. This makes it really difficult to render different kinds of forms, if I've understood the README correctly.
I have two sections of my app, and forms use different markup in these two sections.
The wrappers seem to be configurable, so I can create two wrappers for my two different form styles, however, there's lots of other config that is not specified per wrapper. The boolean_style and the button_class for instance.
What I don't understand is why these things are configured in an initializer instead of in the FormBuilder class? That way I could just create two subclasses and pass them to the simple_form_for helper.
The text was updated successfully, but these errors were encountered:
To be honest because nobody needed to have two forms in the same application with different configurations.
Almost every global configuration can be done at wrapper level too so you can have different configurations for different forms using the wrapper API. Some options were not moved yet but I plan to kill them in a future release.
Yeah it would be great if everything could be configured at the wrapper level. Would also be nice if there were mentions in the README on how to do it.
On a more general note, how come so many gems use this kind of global configuration? I've been building a bunch of apps using Rails engines, and they don't go so good together with global config. Oftentimes I find myself wanting a different setup per app engine.
On a more general note, how come so many gems use this kind of global configuration? I've been building a bunch of apps using Rails engines, and they don't go so good together with global config. Oftentimes I find myself wanting a different setup per app engine.
I guess it is a historical reason. Simple Form for example was created even before Rails Engines existed. It is not easy to do this kind of design change in a stable gem so we had to do it gradually. My plan is to use wrappers API to define all the configurations, but this doesn't fix the engine problem yet, but I believe it is possible.
All config regarding how to render the forms are stored on the SimpleForm module. This makes it really difficult to render different kinds of forms, if I've understood the README correctly.
I have two sections of my app, and forms use different markup in these two sections.
The
wrappers
seem to be configurable, so I can create two wrappers for my two different form styles, however, there's lots of other config that is not specified per wrapper. Theboolean_style
and thebutton_class
for instance.What I don't understand is why these things are configured in an initializer instead of in the FormBuilder class? That way I could just create two subclasses and pass them to the
simple_form_for
helper.The text was updated successfully, but these errors were encountered: