unfortunately when using controllers that way, I don’t think there is
any way to setup routes any differently. perhaps someone else on the
list has some additional insight.
one potential problem would be if someone tried to access an admin
route that did not exist, such as /admin/whatever’. it would not
match any of your defined admin routes and would then pass to
‘:category/:content’ which would be routed to ‘home/show’…something
to watch for. i think one additional route to catch anything else.
‘admin/:missing’ might be needed and could be routed to a 404 page or
keep in mind that you’re not going to be editing routes much. so while
you might consider it ugly, it’s only in the routes.rb file and not
the rest of your code.
you might want to go one extra step and use named routes as that will
make the rest of your code a bit prettier.
map.category_admin ‘admin/category’, :controller => ‘admin/category’
then any link to that will be
link_to “Category Admin”, category_admin_url, …
link_to “Category Admin”, :controller => “admin/category”