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 -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a9339cf10a91e8e4cce4af596fcec85c%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
On Mon, May 20, 2013 at 3:36 PM, Marcio Pugina <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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 Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yCGvYYxvF%3DVciL1WFu4r25GRvVugDfZCXndLGcu42U40g%40mail.gmail.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.