mdude
1
I’m a basecamp user. At basecamp URl such as
http://myproject.projectpath.com/projects/488470/milestones/new, both
projects and milestones are controllers (are they?), 488470 is project
id and new is method of milestones. Usually, you get
http://hostname/controller/method/otherinfo, but how they put their url
together and let rails now how to interprete the URL? via route? Can
any body gives some details?
Thanks a lot!
mdude
2
mdude wrote:
I’m a basecamp user. At basecamp URl such as
http://myproject.projectpath.com/projects/488470/milestones/new, both
projects and milestones are controllers (are they?), 488470 is project
id and new is method of milestones. Usually, you get
http://hostname/controller/method/otherinfo, but how they put their url
together and let rails now how to interprete the URL? via route? Can
any body gives some details?
Thanks a lot!
I can’t say for sure about the BaseCamp internals, but this is only
mapping to one controller.
Probably some routing like:
map.connect ‘projects/:project_id/milestones/:action’,
:controller => milestone
or, if you put it in the right sequence of routes so that it doesn’t
conflict with other routes you might could just do:
map.connect ‘projects/:project_id/:controller/:action’