1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #44093 from motine/doc-hint-for-fields_for

add hint to ActionView's fields_for
This commit is contained in:
Rafael Mendonça França 2022-02-09 20:17:01 -05:00 committed by GitHub
commit b961af3345
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1018,9 +1018,10 @@ module ActionView
# <% end %>
#
# 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>include_id: false</tt>
# to prevent fields_for from rendering it automatically.
# to store the ID of the record if it responds to <tt>persisted?</tt>.
# There are circumstances where this hidden field is not needed and you
# can pass <tt>include_id: false</tt> to prevent fields_for from
# rendering it automatically.
def fields_for(record_name, record_object = nil, options = {}, &block)
options = { model: record_object, allow_method_names_outside_object: false, skip_default_ids: false }.merge!(options)