40

In my routes.rb I have:

get "projects/:category_id" => "projects#index"

When I write projects_path(1) the generated URL is /projects.1 instead of /projects/1. Do you know why this is happening? Here is the output of rake routes:

 GET /projects/:category_id(.:format) projects#index
4

1 回答 1

99

projects_path是索引,它只接受一个参数:格式。你要project_path(1)

于 2013-04-28T16:26:53.297 回答