This project is archived and is in readonly mode.
accepts_nested_attributes_for not working per docs
Reported by Mikel Lindsaar | January 24th, 2010 @ 04:46 AM | in 3.0.2
I am updating the Rails Guides and found that accepts_nested_attributes_for does not seem to be working per documentation.
On Rails master cloned and vendor'd as of 24 Jan, 2010, Ruby 1.8.7
The gist of the matter is at: http://gist.github.com/284996
accepts_nested_attributes does not seem to be working per docs on Rails 3. The following code snippets produce:
 undefined method `_delete' for #<Tag:0x1034414a8>
when you try and view a post that has a tag using the usual idiom:
  <div class="field">
    <%= tag_form.label :_delete, 'Remove:' %>
    <%= tag_form.check_box :_delete %>
  </div>
This does work as advertised on Rails 2.3.5
You can clone the whole Rails 3.0 app just waiting for your gem bundle at
github.com/mikel/getting-started-code
Assigning it to Jose because you touched the code last :)
Mikel
Comments and changes to this ticket
- 
        

Mikel Lindsaar January 24th, 2010 @ 08:32 AM
This was deprecated in 2.3.4 for destroy, confirmed that destory works and updated the docs. Jose will put the deprecation back in.
 - 
        

Mikel Lindsaar January 24th, 2010 @ 09:48 AM
- State changed from new to resolved
 
Fixed documentation, was deprecated earlier. Closed
 - 
        

Mikel Lindsaar January 24th, 2010 @ 09:48 AM
- Assigned user changed from José Valim to Mikel Lindsaar
 
 - 
            
        

drhenner (at yahoo) August 15th, 2010 @ 10:38 PM
- Importance changed from  to High
 
Just as an FYI: if you are using rails 3 use this:
<%= tag_form.label :_destroy, 'Remove:' %> <%= tag_form.check_box :_delete %> - 
            
        

 - 
        

 - 
            
        

 
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>