Hi. I have 3 tables, forum, post and reply.
I would like to access replies with the url forums/x/posts/x/replies/x
....
I have the posts nested within the forums, but if I wanted to add
another layer, would I have to do this on a separate line in the routes
file or simply add :has_many => :replies to what I already have:
If you’re still interested in doing it and I can’t disuade you:
map.resources :forums do |forum|
forum.resources :posts do |post|
post.resources :replies
end
end
Again, I must warn you that this leads to really ugly URLs. It’s best to only do two level deep nested routes, as in forums/1/posts and posts/1/replies/1, makes your URLs shorter and prettier.