document :hidden_field_id option for fields_for #8306

Merged
merged 1 commit into from Nov 24, 2012

Conversation

Projects
None yet
4 participants
Member

senny commented Nov 24, 2012

I once submitted a patch to prevent fields_for from rendering hidden fields for the ID automatically. I just noticed that I forgot to document said option.

This patch adds the necessary documentation.

actionpack/lib/action_view/helpers/form_helper.rb
+ #
+ # Note that fields_for will automatically generate a hidden field
+ # to store the ID of the record. There are circumstances where this
+ # hidden field is not needed and you can pass <tt>:hidden_field_id => false</tt>
@carlosantoniodasilva

carlosantoniodasilva Nov 24, 2012

Owner

Just noticed, can you use the new hash style please? Thanks ❤️

@senny

senny Nov 24, 2012

Member

oh man, this one always gets me 😓

It should be fixed now.

Member

steveklabnik commented Nov 24, 2012

:shipit:

carlosantoniodasilva added a commit that referenced this pull request Nov 24, 2012

Merge pull request #8306 from senny/documentation_for_hidden_field_id
Document :hidden_field_id option for fields_for [ci skip]

@carlosantoniodasilva carlosantoniodasilva merged commit e95b9d6 into rails:master Nov 24, 2012

Thanks mate ❤️

demisx commented Dec 13, 2013

Isn't the include_id: false the option to use in order to disable hidden id generation or am I missing something?
I mean:

f.fields_for :comments, include_id: false
Member

senny commented Dec 13, 2013

demisx commented Dec 13, 2013

I see. Landed here from Google and didn't realize this was that old. Thank you for clarification.

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