Nerian
Nerian

Reputation: 16197

Rails3 - Nested resources

How to use nested resources

Error:

No route matches {:controller=>"documents"}

Code:

<%= link_to "Documentos", school_documents_path(@school)

Routes:

resources :schools do
   resources :documents, :only => [:index]
   resources :tasks, :only => [:index]
end 

DocumentsController:

class DocumentsController < ApplicationController
  def index
  end
end

What is the error?

Upvotes: 0

Views: 418

Answers (2)

Nerian
Nerian

Reputation: 16197

Restart application :)

Upvotes: 1

Justin Soliz
Justin Soliz

Reputation: 2811

this might be a typo but are you missing the end from your index method?

Upvotes: 0

Related Questions