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

Improving 'Customizing Form Builder' section with example [ci skip] #18540

Merged
merged 1 commit into from
Jan 31, 2015
Merged

Improving 'Customizing Form Builder' section with example [ci skip] #18540

merged 1 commit into from
Jan 31, 2015

Conversation

andreynering
Copy link
Contributor

A simple example about how to do it.

```ruby
def labeled_form_for(record, options = {})
options.merge!(builder: LabellingFormBuilder)
form_for record, options do |f|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also pass the block to form_for:

def labeled_form_for(record, options = {}, &block)
  options.merge!(builder: LabellingFormBuilder)
  form_for record, options, &block
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@georgeclaghorn Much better. 👍 Updated.

robin850 added a commit that referenced this pull request Jan 31, 2015
Improving 'Customizing Form Builder' section with example [ci skip]
@robin850 robin850 merged commit 34e562b into rails:master Jan 31, 2015
@robin850
Copy link
Member

Thanks!

@andreynering andreynering deleted the guides-custom-form-builder branch January 31, 2015 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants