Actually I think att_fu does an admirable job of spitting out the
right HTML.
Using different models than those specified above
:design has_many :color_ways
:color_way has_many :sizes
In my r_c controller for designs:
new_action.before { @color_way = @design.color_ways.build }
And the views:
_form.html.haml
#color_ways
%h2 Color Ways
%fieldset
= f.render_associated_form(@object.color_ways, :new => 1)
= f.add_associated_link('Add Color Way', @object.color_ways.build
_color_way.html.haml
%p.color_way
%label Name
= f.text_field :name
#sizes
= f.render_associated_form(@color_way.sizes, :new => 1)
= f.add_associated_link('Add Size', @color_way.sizes.build)
_size.html.haml
%p.size
%label Size Name
= f.text_field :name
Here is the generated HTML
http://pastie.textmate.org/private/aia8qdztvog1aufohkguw
Now this is obviously me really bastardizing the hell out of your
plugin and I'll understand if this is something that Just Wont Work®.
But it is interesting to see just how far things can be pushed and I
have a feeling this may not be as complicated as it seems.
Take a look and let me know if I need to lay off the dream pipes. :p