Forum: Ruby on Rails Search results

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
F565073d807785392349ebe8e58016bb?d=identicon&s=25 Kesi Asstami (ciroval)
on 2007-06-08 00:01
Hi, I am new to Ruby, I am a Java expert.
I don't know how to handle the results of a search... I have read a lot,
but nobody seems to give examples of that.
Do I get an ArrayList from a Table?
Do I get fields?
How can I identify them?
Do I have to parse them to a Class like:  Person user =

Please, help me...
981b75f949c81efad3bc4b3c4ea88332?d=identicon&s=25 Scott Becker (Guest)
on 2007-06-08 00:08
(Received via mailing list)
On 6/7/07, Kesi Asstami <> wrote:
> Please, help me...

Assuming you are referring to Rails specifically, not just Ruby. As an
aside, get the book Agile Web Development with Rails. (Use the Google).

ActiveRecord's finders either return an array:

   @users = User.find(:all, :conditions => ['name = ?', 'scott'])

or one object

   @user = User.find(1) # gets the user with an ID of one.

to iterate, you can use .each:

  @users.each do |user|

Scott Becker
Electro Interactive, Inc.
This topic is locked and can not be replied to.