Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable form_builder in config #1659

Open
fschwahn opened this issue May 9, 2019 · 0 comments
Open

Configurable form_builder in config #1659

fschwahn opened this issue May 9, 2019 · 0 comments

Comments

@fschwahn
Copy link
Contributor

fschwahn commented May 9, 2019

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?

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

No branches or pull requests

2 participants