# Search results

**URL:** <https://www.ruby-forum.com/t/search-results/106272>\
**Category:** Rails\
**Created:** [June 8, 2007, 12:01am UTC](https://www.ruby-forum.com/t/search-results/106272 "2007-06-08T00:01:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ciroval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b77776/32.png) [@ciroval](https://www.ruby-forum.com/u/ciroval)\
**Post date:** [June 8, 2007, 12:01am UTC](https://www.ruby-forum.com/t/search-results/106272/1 "2007-06-08T00:01:04Z")

</div>

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 =  
Person(personlist.get(i));?

Please, help me…

---

<div class="post-metadata">

**Author:** ![ciroval](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b77776/32.png) [@ciroval](https://www.ruby-forum.com/u/ciroval)\
**Post date:** [June 8, 2007, 12:08am UTC](https://www.ruby-forum.com/t/search-results/106272/2 "2007-06-08T00:08:47Z")

</div>

On 6/7/07, Kesi A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Please, help me…

Assuming you are referring to Rails specifically, not just Ruby. As an  
aside, get the book Agile Web D. 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|  
puts user.name  
end

–  
Scott B.  
Electro Interactive, Inc.  
Blog: [http://synthesis.sbecker.net](http://synthesis.sbecker.net)
