Posts [ 3 ]

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.

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!

Re: Question about Routes...

Having read a couple of the other posts by folks like BraveDave I was thinking about going down the sub-domain route. I'll take a read of that Wiki article - at the end of the day this decision might be best put forward to the users to see which they'd prefer. It it *their* app after all :-)

In fact I've just noticed this post from this forum about the Locations plugins.