I have rescently jumped on the REST-wagon and am enjoying it a lot.
Now I have run into a problem:
Lets say I have a model called Collection which has_many Items. I know
(from Peep Code railscast, great stuff btw) how to create new Items
belonging to a certain Collection. In other words I can create Items
for an existing Collection. Now I want to do this:
On the "create new collection" form I want to be able to create new
Items without having to create the Collection first. This means the
create action of collections_controller needs to create new Item
objects. This can be done within the create method but this will
violate the DRY principle. I would like to use the create action in
the items_controller to create the new Items.
Grateful on any input on how to do this in an elegant way.