So I just got a cryptic error message: "Wrong number of arguments (0 for 1)" when using the check_box helper thus:
f.check_box :notify
Clearly I am providing the right number of arguments here. However, the problem lies with the notify method I have created. Observe...
script/console
Event.new.method :notify
=> #<Method: Event(ActiveRecord::Callbacks)#notify>
Turns out the notify method is already taken and is an ActiveRecord Call back. Doh!
Comments left...
I like to glance at the Reserved Words list on the wiki when picking names for models and attributes. This can help a lot in preventing tricky conflicts like this.
Ryan Bates at 03 Oct 07 at 15:39
Good tip Ryan, definitely a link to have handy when trying to track down funky errors!
Michael @ SEOG at 11 Mar 08 at 01:41
Thanks for the debugging hint, never faced it yet, but worth noticing. Kif.
PHP code sucks at 15 Jun 08 at 09:01
Articles Archive →
Got something to say?