Skip to content

Configurable form_builder in config #1659

Open
@fschwahn

Description

I have some custom behavior which applies to all forms in my app. I can either follow https://github.com/plataformatec/simple_form#custom-form-builder (and replace all simple_form_for-calls) or monkeypatch SimpleForm::FormBuilder, but I was thinking if it might make sense to make a custom form_builder configurable. This would allow users to define something like a ApplicationFormBuilder (analogous to ApplicationRecord etc.) which has app-specific behavior. Configuration would simply be:

SimpleForm.setup do |config|
  config.form_builder = "ApplicationFormBuilder"
end

I'd be willing to put a PR together, but I first wanted to get a sense if this would be considered a useful addition?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions