Class query: Classname.find(class)

Hi,
I have implemented the following:

@newUser = Usertbl.new
@newUser.username = 'first'
@newUser.userpassword = 'last'
@userDetails = Usertbl.find(@newUser)

and am getting the following error message:

‘Couldn’t find Usertbl with ID=#Usertbl:0x4783fa8

Why is this not allowed?


Regards

Andrew

find() expects either numeric ids or :first or :all followed by more
conditions. Please see
http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M000992
for more info.

  • Doug Barth

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs