在 routes.rb 我有:
resources :dtests do
resources :dquestions
end
“/dtests/2/dquestions/3”类型的所有活动和路线都正常工作,但是当我尝试输入“dtests/2/dquestions”时,出现错误:
No route matches {:action=>"show", :controller=>"dquestions", :locale=>:en, :dtest_id=>#<Dquestion id: 1, question_text: "dfs", count_answer: 4, dtest_id: "1", created_at: "2013-06-01 09:32:41", updated_at: "2013-06-01 09:32:41">}
在服务器日志中:
Dquestion Load (0.5ms) SELECT "dquestions".* FROM "dquestions" WHERE "dquestions"."dtest_id" = 1
default_url_options is passed options: {}
Rendered dquestions/index.html.erb within layouts/application (39.5ms)
Completed 500 Internal Server Error in 106ms
ActionController::RoutingError
请告诉我,有什么问题?