我有一条指定路线:
map.find '/find/:category/:state/:search_term/:permalink', :search_term=>nil, :controller=>'find', :action=>'show_match'
以下URL与之匹配,工作正常:
http://localhost:3000/find/cars/ca/TestSeachTerm/bumpedupphoto-test
但是,如果我去掉最后第二个参数,即“testsearchterm”,那么路由将无法匹配,即使我在路由中有:search_term=>nil。
http://localhost:3000/find/cars/ca//bumpedupphoto-test
有人知道我做错了什么吗?正在努力解决这个问题几天了。
谢谢!