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.
7759594c66801d6f311ff38fd3ddef2a?d=identicon&s=25 Chris Gunnels (ballhogjoni)
on 2009-03-19 19:33
is there a way to run a obj.each loop in the script/console?
F04a22457fcbfee2afc77e77482abe08?d=identicon&s=25 Rails List (railslist)
on 2009-03-19 19:37
Chris Gunnels 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
7759594c66801d6f311ff38fd3ddef2a?d=identicon&s=25 Chris Gunnels (ballhogjoni)
on 2009-03-19 19:43
cool cool thanks...

>>>@a=Class.find(:all)
>>>@a.each do
> ?>  yourstuff..
>>>end
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2009-03-19 23:26
(Received via mailing list)
On Thu, Mar 19, 2009 at 11:33 AM, Chris Gunnels
<rails-mailing-list@andreas-s.net> 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 Schroeder ------------------------ hassan.schroeder@gmail.com
This topic is locked and can not be replied to.