Forum: Ruby on Rails newbi: Save console commands as script (e.g. rake task?)

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.
Fe16793fa65a6c99cca5a7a9fc2e7c3b?d=identicon&s=25 Thomas Mann (pixtur)
on 2007-07-14 16:02
Hello,

I am new to ruby but I am already with love with the console. What I am
looking for is a way, to write a parser that reads a text file and
creates database entries from it.

Something like:

  for line in lines
   p= Product.new
   p.name=line
   p.save
  end
This topic is locked and can not be replied to.