s.tasks.build
ArgumentError: wrong number of arguments (1 for 0)
from /Applications/Locomotive2/Bundles/
standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/
activerecord-1.15.3/lib/active_record/associations/
has_many_association.rb:13:in initialize' from /Applications/Locomotive2/Bundles/ standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/ activerecord-1.15.3/lib/active_record/associations/ has_many_association.rb:13:innew’
from /Applications/Locomotive2/Bundles/
standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/
activerecord-1.15.3/lib/active_record/associations/
has_many_association.rb:13:in `build’
from (irb):2
Am I doing something stupid? I would expect this to work.
s.tasks.build
ArgumentError: wrong number of arguments (1 for 0)
from /Applications/Locomotive2/Bundles/
standardRailsMar2007.locobundle/i386/lib/ruby/gems/1.8/gems/
activerecord-1.15.3/lib/active_record/associations/
has_many_association.rb:13:in `initialize’
Post your models. Possibly has_many declaration is wrong, or Task is
not derived from ActiveRecord::Base? Does
collection.build(attributes = {}) - returns a new object of the
collection type that has been instantiated with attributes and linked
to this object through a foreign key but has not yet been saved. Note: This only works if an associated object already exists, not if
it’s nil!
You shouldn’t have to save it… that’s the whole point.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.