map.resources :houses do |house|
house.resources :walls, :has_many => :damages
house.resources :windows, :has_many => :damages
house.resources :doors, :has_many => :damages
The :damages resource appears four times, touching every other
resource and the entire application seems to hinge on the concept
However, in terms of template and controller lines, Damage probably
(simplistically) only accounts for about 20% the application total.
A recent thread on the ruby list has got me thinking about what a controller would look like for nested resources.
What would the damages controller look like in this situation? How much, and what code goes into determining what
objects are to be setup?
For my project I have a situation where I have
map.resources :books, :has_many => :clips
This is fine, I can deal with this, but I would also like another part where I can look into others books
But I don’t really know what the controller should look like to set this up.
Any tips or links to discussion on this would be great