Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: yossarian dunbar
RE: Nil object evaluating parent.children? [ reply ]  
2006-07-27 15:42
The answer to this was actually pretty simple.

I had:

<%= text_field 'concept', 'title', :size => 30 %>

When I should have had:

<%= text_field 'concept[]', 'title', :size => 30 %>

By: yossarian dunbar
Nil object evaluating parent.children? [ reply ]  
2006-07-18 12:54
Hi, thanks for the guide, but I am having a problem. I've got my models set up as

class Project < ActiveRecord::Base
validates_presence_of :title
has_many :concepts
end

However, on create and update in my ProjectController I am getting the following error:

NoMethodError in ProjectController#update

You have a nil object when you didn't expect it!
The error occured while evaluating nil.concepts

This is strange, as when I execute a breakpoint the @project object is clearly there and populated (during an update, it has an id, on creation it doesn't).

This plug-in looks great, it'll do everything I want from it if I can get past this, but I'm a little bit stumped here.

Using Rails 1.1 release, MySQL 5.0.19, Ruby 1.8.4 on Debian.