I have following models:
States has_many Cities
Cities has_many Streets
Streets has_many Houses
Houses has_many People
In the routes.rb I have all these set as nested resources so I can view
the Cities of specific State as /states/1/cities, all the Streets of
City as /cities/15/streets, all the Streets of specific State as
Now in the houses#show action I would like to list all the People in
House. In the streets#show I would like to list all the Houses and all
People in this Street, and the same for cities#show and states#show
I would like to be DRY, so when there is a code for listing People in
people#index action, I would like to somehow render /houses/1/people in
houses#show, /streets/123/houses and /streets/123/people in
etc. Without the layout.
When I call
render :template => "/houses/123/people" the Rails throws
error that there is no such template.
Thank you for your time.