Topic: Question about Routes...
I'm just getting to grips with the more usual RoR methods but haven't really touched on routes before now. However I'm now trying to write an application (it might end up as several to be honest) that will deal with a series of projects which are configurable by the administrator of the application. I'll give a couple of scenarios that I'd like to see on the URL's and go from there. All the names here are examples :-)
Say I've got three projects - apples, bananas, cherries. I'd like to be able to access these by the following format.
I'm pretty sure I can setup the routes.rb (with my current level of knowledge) to forward these requests to www.domain.com/projects/apples etc.
Each of these projects could have there own sub-projects within them as well:
This is where I come a little unstuck with the routes process. Take the "defects" sub-project. Ideally I'd like the following URL:
to forward the user on to show the first defect in the project bananas. However I'm not sure how to configure the routes file so that both the project and the defect number come through as parameters without messing up the rest of the routes in the file (take a default routes file as a starting position).
I'm also a little unsure if my approach here is the best one to take. There's also the problem of administering the projects so www.domain.com/apples/admin/ should take you to the administration page for the project. Should I use an "admin" folder then put the controller/action on after? How would this affect the setup of the routes.rb file?
Feel free to ask me questions on this - I'm kind of thinking out loud at the moment and I may not have explained this in the best fashion!