2
我添加了一個測試來確認我在我的意見中得到的錯誤。沒有路線匹配與耙路線的錯誤衝突
2) NodesController GET /nodes/:id should be successful
Failure/Error: get :show, :id => @node.id
ActionController::RoutingError:
No route matches {:id=>"nodexyz.example.com", :controller=>"nodes", :action=>"show"}
# ./spec/controllers/nodes_controller_spec.rb:21:in `block (3 levels) in <top (required)>'
然而,耙路似乎要被罰款
nodes GET /nodes(.:format) {:action=>"index", :controller=>"nodes"}
node GET /nodes/:id(.:format) {:action=>"show", :controller=>"nodes"}
爲什麼我的測試(和應用程序)認爲沒有路由匹配時,顯然這應該與後者的路線?
什麼當你發生在'通過去除說期間id'簡單?看起來路由器可能認爲ID中的句點實際上是一個無效的格式。 –
你的'routes.rb'的一部分 – Bohdan