0

Is there a Rails way to manually populate databases? I can use PostgreSQL with SQL Inserts but I was wondering if there was a Rails way

1
  • The table is "products". They won't change in the future. I have to add them to the database by hand. Commented Mar 7, 2012 at 21:43

1 Answer 1

1

well you could add create statemants to db/seeds.rb and run rake db:seed

Product.create( 
  [ 
    { :price => 120.00, :item => "table" },
    { :price => 49.99, :item => "chair" }
  ]
)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.