I tried to make this work http://guides.rubyonrails.org/form_helpers.html#building-complex-forms 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 ---------------------------------------------------------------------------------------------------------------------------------------------- btw the line 28 in project controller is @project.tasks.build -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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. On Fri, Jul 22, 2011 at 6:38 AM, Angelo Cordova <acordinz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I tried to make this work > > http://guides.rubyonrails.org/form_helpers.html#building-complex-forms > > 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 > > ---------------------------------------------------------------------------------------------------------------------------------------------- > > btw the line 28 in project controller is > > @project.tasks.build > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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 On Jul 22, 6:00 am, Chris Kottom <ch...-kMviOf/NVQxZWXO/OqhO/A@public.gmane.org> wrote:> 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. > > > > > > > > On Fri, Jul 22, 2011 at 6:38 AM, Angelo Cordova <acord...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I tried to make this work > > >http://guides.rubyonrails.org/form_helpers.html#building-complex-forms > > > 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 > > > ---------------------------------------------------------------------------------------------------------------------------------------------- > > > btw the line 28 in project controller is > > > @project.tasks.build > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.