Activerecord to write to database

I created a db with rake migrate and added to columns, symbol and
cur_price in a table call Financials. I want to use activererecord from
a script to write the data from the script to the database. Could
someone please provide an example.

Model:
class Financials < ActiveRecord::Base
attr_accessible :symbol, :cur_price

Ruby Script parameters:

symbols = [ 'csco",“c”,“bac”

cur_prices = [‘10’,‘20’,‘30’]

Thanks in advance

On Mon, May 20, 2013 at 3:36 PM, Marcio P. [email protected]
wrote:

I created a db with rake migrate and added to columns, symbol and
cur_price in a table call Financials. I want to use activererecord from
a script to write the data from the script to the database. Could
someone please provide an example.

See: rails runner --help


Hassan S. ------------------------ [email protected]

twitter: @hassan