Rails3中 - 嵌套资源
问题描述:
如何使用嵌套资源Rails3中 - 嵌套资源
错误:
No route matches {:controller=>"documents"}
代码:
<%= link_to "Documentos", school_documents_path(@school)
路线:
resources :schools do
resources :documents, :only => [:index]
resources :tasks, :only => [:index]
end
DocumentsController:
class DocumentsController < ApplicationController
def index
end
end
什么是错误?
答
重新启动应用程序:)
您的代码看起来没问题。据我所知,它应该工作。什么'耙路线'说?你是否确定错误发生在你说的那一行? – iain 2010-12-11 17:28:30