Nested Object Forms doesn’t use _delete anymore in Rails 3

<% unless child_form.object.new_record? %>
<%= child_form.check_box ‘_delete’ %>
<%= child_form.label ‘_delete’, ‘Remove’ %>
<% end %>

When you search for Nested forms, you get Ryan’s page up there. But it’s over 3 years old, and you’ll find that it’s actually not ‘_delete’, but actually, ‘_destroy’.

None of the documentation anywhere mentions this, even at the Rails Guides

I should just get in the habit of reading the Rails source when nothing’s working. Gah. /rant.

Advertisements

2 thoughts on “Nested Object Forms doesn’t use _delete anymore in Rails 3

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s