views:

24

answers:

0

Hello!

I have a model called Forum which has_many Topics. In routes.rb it's set up like this:

resources :forums do
  resources :topics
end

This naturally gives me URLs that look like this:

http://localhost/forums
http://localhost/forums/1
http://localhost/forums/1/topics
http://localhost/forums/1/topics/2

…you get the picture.

I however would like to simplify the URLs to look like this instead:

http://localhost/forums
http://localhost/forums/1
http://localhost/forums/1/2

I'd be very grateful if anyone could advice me on how to accomplish this.

I'm working with Rails 3.

Cheers!