1
在我的路由配置我有以下幾點:問題的軌道路由
resources :users do
resources :apps, :controller => :user_apps
end
rake routes
包括以下內容:
user_apps GET /users/:user_id/apps(.:format) {:action=>"index", :controller=>"user_apps"}
user_apps POST /users/:user_id/apps(.:format) {:action=>"create", :controller=>"user_apps"}
new_user_app GET /users/:user_id/apps/new(.:format) {:action=>"new", :controller=>"user_apps"}
edit_user_app GET /users/:user_id/apps/:id/edit(.:format) {:action=>"edit", :controller=>"user_apps"}
user_app GET /users/:user_id/apps/:id(.:format) {:action=>"show", :controller=>"user_apps"}
user_app PUT /users/:user_id/apps/:id(.:format) {:action=>"update", :controller=>"user_apps"}
user_app DELETE /users/:user_id/apps/:id(.:format) {:action=>"destroy", :controller=>"user_apps"}
然而,當我嘗試訪問如user_apps_path(1,2)
我得到/users/1/apps.2
而非/users/1/apps/2
。
我哪裏錯了?
我使用的是軌道3
非常感謝。我真的很尷尬。 – grifaton 2011-01-31 21:25:54