次の URL で checkpoints#index メソッドにアクセスしようとしています。
http://localhost:3000/lessons/introductions/checkpoints/
しかし、私はこのエラーが発生します:
No route matches {:action=>"show", :controller=>"checkpoints", :lesson_id=>#<Checkpoint id: 1, checkpoint: "Definition of Monetary Policy", url: "http://www.youtube.com/watch?v=HX3wOWN9-sM", objective: "Define monetary policy", description: "Welcome to this series of lectures on monetary poli...", question: "What is the definition of monetary policy?", hint: "It is the deliberate manipulation of something OR s...", answer: "-", lesson_id: 8, created_at: "2012-06-29 07:21:47", updated_at: "2012-06-30 08:24:15", slug: "definition-of-monetary-policy">}
私の「レーキルート」では次のようになるため、これは当てはまりません。
lesson_checkpoints GET /lessons/:lesson_id/checkpoints(.:format) checkpoints#index
POST /lessons/:lesson_id/checkpoints(.:format) checkpoints#create
new_lesson_checkpoint GET /lessons/:lesson_id/checkpoints/new(.:format) checkpoints#new
edit_lesson_checkpoint GET /lessons/:lesson_id/checkpoints/:id/edit(.:format) checkpoints#edit
lesson_checkpoint GET /lessons/:lesson_id/checkpoints/:id(.:format) checkpoints#show
PUT /lessons/:lesson_id/checkpoints/:id(.:format) checkpoints#update
DELETE /lessons/:lesson_id/checkpoints/:id(.:format) checkpoints#destroy`
#show アクションではなく #index アクションをロードしませんか? このエラーの考えられる理由を知っている人はいますか?
これは私のroutes.rbがどのように見えるかです:
resources :lessons do
resources :checkpoints
end
resources :lessons
resources :topics do
resources :lessons
end
#Devise Routes
devise_for :users
resources :subjects do
resources :topics
end