提交 34e562b0 编写于 作者: R Robin Dupret

Merge pull request #18540 from andreynering/guides-custom-form-builder

Improving 'Customizing Form Builder' section with example [ci skip]
......@@ -687,7 +687,14 @@ class LabellingFormBuilder < ActionView::Helpers::FormBuilder
end
```
If you reuse this frequently you could define a `labeled_form_for` helper that automatically applies the `builder: LabellingFormBuilder` option.
If you reuse this frequently you could define a `labeled_form_for` helper that automatically applies the `builder: LabellingFormBuilder` option:
```ruby
def labeled_form_for(record, options = {}, &block)
options.merge! builder: LabellingFormBuilder
form_for record, options, &block
end
```
The form builder used also determines what happens when you do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册