Complex form problem

I tried to make this work

the example of

Handle Multiple Models in One Form from Advanced Rails Recipes

but, when I want to create a new project I get this error:

NoMethodError in ProyectsController#new

undefined method `tasks’ for nil:NilClass

Rails.root: /home/angelo/prueba
Application Trace | Framework Trace | Full Trace

app/controllers/projects_controller.rb:28:in `new’

Request

Parameters:

None

Show session dump

Show env dump
Response

Headers:

None

You didn’t include any source code, and without that, no one is going to
be
able to tell you for sure what you’re doing wrong. The output here
indicates that the @project reference isn’t being initialized. Is there
actually a call like @project = Project.new(…) in the action method?

If this turns out not to be the problem, please include at least the
full
ProjectsController#new source when you respond.

The source code is in the example,(http://guides.rubyonrails.org/
form_helpers.html#building-complex-forms the example of Handle
Multiple Models in One Form from Advanced Rails Recipes ) I wanted to
test that example by myself… that’s why I didn’t wrote any line of
code

and yes, the call @project = Project.new exists