Hey everyone,

I pushed http://github.com/snusnu/dm-accepts_nested_attributes/tree/master
the other day. There is also a blogpost at
http://sick.snusnu.info/2009/04/08/dm-accepts_nested_attributes/

With this in place, there should be nothing (serious) stopping you
from writing those nice multimodel forms and submit them to a standard
REST controller.

That said, currently (as far as I know) only rails also has support
for nested attribute assignment in its view helpers (form_for and
fields_for), merb (maybe) doesn't, please correct me if I'm wrong?.
However, this should be no big deal, since there's nothing stopping
you from writing the html input fields with proper name attributes
yourself. I do this anyway most of the time, so I really don't care
too much.

Of course, this is still all very fresh, and I expect it to have quite
a few bugs still. Also, I haven't tested it in a real world app yet,
but there are quite some specs in place, to build upon. I will start
using it in my current project next week, and of course will fix bugs
as they come along.

Currently, the plugin only works with dm-core-0.9.11 and I expect that
quite some changes will be needed to make it work with dm-core/next
branch, but atm I can't spend time on this because I only use
dm-core-0.9.11.

I'd really appreciate, if anyone takes the time to look into it,
discuss it, fork it, patch it, whatever. Let's make this rock solid,
so that once rails3 /merb is orm agnostic, no one can say that they
don't use datamapper because they can't do nested attribute assignment
with it :)

Some links on the topic:
The commit history of this feature in activerecord
http://github.com/rails/rails/commits/master/activerecord/lib/active_record/nested_attributes.rb
A blogpost explaining how to use this with activerecord (should be the
same for dm)
http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nested-attributes
A really nice article explaining nested params passing in general
http://wonderfullyflawed.com/2009/02/17/rails-forms-microformat/

cheers
snusnu

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to