Hey Everybody,

Part of a project I'm working on has a wishlist. I've got a List model that has_many Wishes. (Think Ta-Da Lists by 37Signals). When editing a list, all of the wishes are edited too. See the pastie:

http://pastie.caboo.se/45468

I'm using the "update" method to update all those wishes at once:

Wish.update(params['wish'].keys, params['wish'].values)

My problem is deleting a wish from the list. I've implemented the little javascript function that hides the fields and sets their values to "", but the controller doesn't know to delete it... it just assumes it is missing. I need something in the controller that checks to see if a wish has empty values, and if so, delete it. Is there an existing method to do this? I'm thinking along the lines of the little radio button trick that still sets the value to "0" or "false" when the radio button isn't selected.

Thanks,

-Nathan
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to