Forum: Ruby on Rails is there a way to run a obj.each loop in the script/console?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris G. (Guest)
on 2009-03-19 20:33
is there a way to run a obj.each loop in the script/console?
Rails L. (Guest)
on 2009-03-19 20:37
Chris G. wrote:
> is there a way to run a obj.each loop in the script/console?

Why not.  just use it as you do with each loop.

>>@a=Class.find(:all)
>>@a.each do
?>  yourstuff..
>>end
Chris G. (Guest)
on 2009-03-19 20:43
cool cool thanks...

>>>@a=Class.find(:all)
>>>@a.each do
> ?>  yourstuff..
>>>end
Hassan S. (Guest)
on 2009-03-20 00:26
(Received via mailing list)
On Thu, Mar 19, 2009 at 11:33 AM, Chris G.
<removed_email_address@domain.invalid> wrote:
>
> is there a way to run a obj.each loop in the script/console?

Yes, just type it in like you would anywhere else -- unless I'm totally
missing your actual question :-)

--
Hassan S. ------------------------ removed_email_address@domain.invalid
This topic is locked and can not be replied to.