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...
on 2007-06-08 00:01
on 2007-06-08 00:08
On 6/7/07, Kesi Asstami <firstname.lastname@example.org> 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| puts user.name end -- Scott Becker Electro Interactive, Inc. Blog: http://synthesis.sbecker.net