mardi 28 février 2017

nested routes is working different in rails 3.2 and rail 4

I am using rails 3.2 and having the following routes

resources :projects do  
  resources :assessments  
end 

Now when I am using project_assessment_path(@assessment) in the view, it's assigning some ID as project_id(sample generated path projects/1/assessments/2)

I can't figure out how it's getting the project_id, but when I move to Rails 4 it's giving me the error ActionController::UrlGenerationError - No route matches which is quite expected. But I am wondering how it's working in rails 3.2

Aucun commentaire:

Enregistrer un commentaire