Nester routes issue

This is a snippet of my routes.rb file

map.resources :users do |users|
users.resources :blogs do |blogs|
blogs.resources :articles do |articles|
articles.resources :comments
end
blogs.resources :comments
end
end

Just wondering if it is possible to have the comment model in 2
different places. From the snippet code, a blog can have comments.
it is also possible for articles to have comments as well. I’m just
wondering if there is an easy way to handle this since I will have a
very complicated comments_controller. The comments_controller will
have to determine where it is comming from, either through users/blogs/
articles/comments or user/blog/comment.

Let me know if there is an easier way of doing this.

Thank you.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs