I’ve been reading a lot of posts related to routing and URLS in Rails
lately but I still can’t figure out how to do this:
I have a controller (categories) where I’m using the BetterNestedSet
plugin in order to have a tree structure for categories for my web
project. A “category” is basically like a folder.
I also have another controller (pages) where each “page” is
essentially an HTML-like page. Each “page” is filed underneath a
certain “category”. All of this seems to work at the moment. But I
can’t seem to find any information on how to display a “page” as if it
were filed (like an HTML file in a web directory.) So that it would
look something like this:
Maybe this is the point where you (the reader,) are wondering, “why is
he doing it THIS way…?” And if so, is there a better way to do
this? I realize that if I eventually need to move a page to another
“category” the URL where it was at previously will now be broken. But
for a simple website application it works for me.
Is there a way to have a route that allows for potentially unlimited
directories in the URL?