seeds.rb 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #---
  10. # Excerpted from "Agile Web Development with Rails, 4rd Ed.",
  11. # published by The Pragmatic Bookshelf.
  12. # Copyrights apply to this code. It may not be used to create training material,
  13. # courses, books, articles, and the like. Contact us if you are in doubt.
  14. # We make no guarantees that this code is fit for any purpose.
  15. # Visit http://www.pragmaticprogrammer.com/titles/rails4 for more book information.
  16. #---
  17. # encoding: utf-8
  18. Product.delete_all
  19. Product.create(:title => 'Web Design for Developers',
  20. :description =>
  21. %{<p>
  22. <em>Web Design for Developers</em> will show you how to make your
  23. web-based application look professionally designed. We'll help you
  24. learn how to pick the right colors and fonts, avoid costly interface
  25. and accessibility mistakes -- your application will really come alive.
  26. We'll also walk you through some common Photoshop and CSS techniques
  27. and work through a web site redesign, taking a new design from concept
  28. all the way to implementation.
  29. </p>},
  30. :image_url => '/images/wd4d.jpg',
  31. :price => 42.95)
  32. # . . .
  33. Product.create(:title => 'Programming Ruby 1.9',
  34. :description =>
  35. %{<p>
  36. Ruby is the fastest growing and most exciting dynamic language
  37. out there. If you need to get working programs delivered fast,
  38. you should add Ruby to your toolbox.
  39. </p>},
  40. :image_url => '/images/ruby.jpg',
  41. :price => 49.50)
  42. # . . .
  43. Product.create(:title => 'Rails Test Prescriptions',
  44. :description =>
  45. %{<p>
  46. <em>Rails Test Prescriptions</em> is a comprehensive guide to testing
  47. Rails applications, covering Test-Driven Development from both a
  48. theoretical perspective (why to test) and from a practical perspective
  49. (how to test effectively). It covers the core Rails testing tools and
  50. procedures for Rails 2 and Rails 3, and introduces popular add-ons,
  51. including Cucumber, Shoulda, Machinist, Mocha, and Rcov.
  52. </p>},
  53. :image_url => '/images/rtp.jpg',
  54. :price => 43.75)