my current project is making a diary app, where users can log in and post their articles to which comments can be linked. So the very natural way of implementing this project is something like
resources :users do
resources :articles do
resources :comments
end
end
Class User < ActiveRecord::Base
has_many :articles
end
Class Article < ActiveRecord::Base
belongs_to :user
has_many :comments
end
Class Comment < ActiveRecord::Base
belongs_to :article
end
However, rails guide says the resources should never be nested more than one level. With this relationship, how can I avoid using two-level nested resources?