seeds.rb 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #---
  2. # Excerpted from "Agile Web Development with Rails",
  3. # published by The Pragmatic Bookshelf.
  4. # Copyrights apply to this code. It may not be used to create training material,
  5. # courses, books, articles, and the like. Contact us if you are in doubt.
  6. # We make no guarantees that this code is fit for any purpose.
  7. # Visit http://www.pragmaticprogrammer.com/titles/rails4 for more book information.
  8. #---
  9. # encoding: utf-8
  10. Product.delete_all
  11. Product.create!(title: 'CoffeeScript',
  12. description:
  13. %{<p>
  14. CoffeeScript is JavaScript done right. It provides all of JavaScript's
  15. functionality wrapped in a cleaner, more succinct syntax. In the first
  16. book on this exciting new language, CoffeeScript guru Trevor Burnham
  17. shows you how to hold onto all the power and flexibility of JavaScript
  18. while writing clearer, cleaner, and safer code.
  19. </p>},
  20. image_url: 'cs.jpg',
  21. price: 36.00)
  22. # . . .
  23. Product.create!(title: 'Programming Ruby 1.9 & 2.0',
  24. description:
  25. %{<p>
  26. Ruby is the fastest growing and most exciting dynamic language
  27. out there. If you need to get working programs delivered fast,
  28. you should add Ruby to your toolbox.
  29. </p>},
  30. image_url: 'ruby.jpg',
  31. price: 49.95)
  32. # . . .
  33. Product.create!(title: 'Rails Test Prescriptions',
  34. description:
  35. %{<p>
  36. <em>Rails Test Prescriptions</em> is a comprehensive guide to testing
  37. Rails applications, covering Test-Driven Development from both a
  38. theoretical perspective (why to test) and from a practical perspective
  39. (how to test effectively). It covers the core Rails testing tools and
  40. procedures for Rails 2 and Rails 3, and introduces popular add-ons,
  41. including Cucumber, Shoulda, Machinist, Mocha, and Rcov.
  42. </p>},
  43. image_url: 'rtp.jpg',
  44. price: 34.95)