Skip to content

Commit

Permalink
Trivial doc update on nested attributes delete renaming
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
dudleyf authored and josevalim committed Mar 29, 2010
1 parent 715b34f commit bf563bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions actionpack/lib/action_view/helpers/form_helper.rb
Expand Up @@ -391,15 +391,15 @@ def apply_form_for_options!(object_or_array, options) #:nodoc:
# accepts_nested_attributes_for :address, :allow_destroy => true
# end
#
# Now, when you use a form element with the <tt>_delete</tt> parameter,
# Now, when you use a form element with the <tt>_destroy</tt> parameter,
# with a value that evaluates to +true+, you will destroy the associated
# model (eg. 1, '1', true, or 'true'):
#
# <% form_for @person, :url => { :action => "update" } do |person_form| %>
# ...
# <% person_form.fields_for :address do |address_fields| %>
# ...
# Delete: <%= address_fields.check_box :_delete %>
# Delete: <%= address_fields.check_box :_destroy %>
# <% end %>
# <% end %>
#
Expand Down Expand Up @@ -472,14 +472,14 @@ def apply_form_for_options!(object_or_array, options) #:nodoc:
# end
#
# This will allow you to specify which models to destroy in the
# attributes hash by adding a form element for the <tt>_delete</tt>
# attributes hash by adding a form element for the <tt>_destroy</tt>
# parameter with a value that evaluates to +true+
# (eg. 1, '1', true, or 'true'):
#
# <% form_for @person, :url => { :action => "update" } do |person_form| %>
# ...
# <% person_form.fields_for :projects do |project_fields| %>
# Delete: <%= project_fields.check_box :_delete %>
# Delete: <%= project_fields.check_box :_destroy %>
# <% end %>
# <% end %>
def fields_for(record_or_name_or_array, *args, &block)
Expand Down
4 changes: 2 additions & 2 deletions railties/guides/source/getting_started.textile
Expand Up @@ -1255,8 +1255,8 @@ You'll also need to modify +views/posts/_form.html.erb+ to include the tags:
</p>
<% unless tag_form.object.nil? || tag_form.object.new_record? %>
<p>
<%= tag_form.label :_delete, 'Remove:' %>
<%= tag_form.check_box :_delete %>
<%= tag_form.label :_destroy, 'Remove:' %>
<%= tag_form.check_box :_destroy %>
</p>
<% end %>
<% end %>
Expand Down

0 comments on commit bf563bd

Please sign in to comment.