How to create subpages.

So if the top navigation is

- Home www.example.com/

- About www.example.com/about

...

www.example.com/about/history

...

Would I need to create a new controller for each page category?

The immediately obvious ways that leap to my mind are either that, or manual routing to different controllers. They should all be pretty trivial boilerplate, though, so it shouldn't be too hard. I wouldn't be surprised if there is (or someone could whip up) a gem to make this even easier....

I currently have the top level navigation all done under 1 controller (static_pages_controller.rb) & the routes.rb (match '/about', to: 'static_pages#about').

So I am trying to figure out how I would add the subpages for about (history, location, careers) so they the url www.example.com/about/history etc.

Without a lot of manual routing, off the top of my head, I'd say:

- Make each top-level page its own controller, including an index action - Make each sub-page a new action within that controller

So for instance you'd have an "about" controller, with actions including index (for /about), history (for /about/history), etc., and a "support" controller, with actions including index (for /support), products (for /support/products), and so on.

Or you could put them all in one controller, with more explicit manual routing in routes.rb for the index actions.

-Dave