Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails dot instead of slash in URL

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 
like image 384
nmat Avatar asked Apr 28 '13 16:04

nmat


1 Answers

projects_path is the index, which only takes one argument: the format. You want project_path(1)

like image 177
numbers1311407 Avatar answered Oct 04 '22 05:10

numbers1311407