Ruby on Rails
Friday, April 1, 2011
Sent from my iPhone
No no, the exactly error is "undefined method `sequence' for
nil:NilClass".
It looks I am getting the database object in var "high", but I can't to
get individual items from this object (like "sequence" or "name"). When
I am trying to print the sequence (puts high.sequence), I am getting
error "undefined method `sequence' for nil:NilClass".
This is because more than one record has been returned with your find or it returned you single record search as an array. You have to loop over the items in the collection "high" then you will be able to access each items method.
B.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment