I'm wondering if the _destroy option for forms actually works with dm-
ANA the same as in ActiveRecord... ?

I have a model with:

accepts_nested_attributes_for :answers, :allow_destroy => true

and then in the form, inside the f.fields_for :answers block I have a
checkbox:

a.check_box, :_destroy

And whenever I load that page, I get an error the first time:

undefined method `to_i' for #<DataMapper::Resource::State::Immutable:
0x97f4794>

and the second time, all the answers are just gone.  So it seems like
it's calling destroy on all the answers in the process of trying to
render the page... ??  Am I doing something wrong?  Does dm-ANA not
support _destroy?  I get the same weird results minus the error by
using simply :destroy (it destroys the object while rendering the
page).  Do I need to do something in the Answer model perhaps?

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to