Answer the question
In order to leave comments, you need to log in
How to properly organize nested resources in rails?
I have four resources, how do I properly organize them in a rails application?
There are projects. The projects have conclusions. The conclusions have comments. Comments should contain responses to comments.
I would be glad to detailed manuals on this kind of connections and links to similar applications.
Of particular interest is the design of links in the routes.rb file and application models.
As I understand it, more than two nested links in the routes.rb file are not welcome .. The question arises how to properly and beautifully (in the spirit of DRY) organize such nested resources.
Answer the question
In order to leave comments, you need to log in
On the official site: Rails Routing from the Outside In Ctrl+f on 'nested'
Like this:
resources :projects do
resources :conclusions do
resources :notes do
resources :answers
end
end
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question