我的問題是我想刪除這個URL的querystring部分,並使其乾淨。Rails路線與乾淨的網址
http://staging.mysite.com/mycontroller?name=/philippines/about-manila
目前我有MyController.index()
,我解析了這個方法中的name參數。
我最終希望是這樣的:
http://staging.mysite.com/mycontroller/philippines/about-manila
參數部分'philippines/about-manila'
可以有參數任意數量,像
http://staging.mysite.com/mycontroller/philippines/about-manila/people
我怎麼能在路線做到這一點?
你使用rails2.x或rails3.x? – 2011-03-08 14:05:07
即時通訊使用rails 2.x – r2b2 2011-03-08 14:06:09
http://stackoverflow.com/questions/4690298/how-do-we-identify-parameters-in-a-dynamic-url/4705154#4705154 – jdl 2011-03-08 14:12:12