small medium large xlarge

Generic-user-small
01 Oct 2011, 13:39
Charlie Bright (3 posts)

I am in the middle of Chapter 6. I have downloaded the seed from http://media.pragprog.com/titles/rails4/code/depot_b/db/seeds.rb and ran rake db:seed. I am using mssql. The data in the products table does not match the “Listing Products” on page 76; I assume that this is not an issue.

I loaded the images from two sources in app/assets/images. I have visually verified that the file names of the images in assets/images match the names in the html. When I route to localhost:3000/products the images do not load. Here is the html:

  <a href="/products/2">Show</a><br/>
  <a href="/products/2/edit">Edit</a><br/>

  <a href="/products/2" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Destroy</a>
</td>

</tr>

Ruby
Programming Ruby 1.9
Ruby is the fastest growing and most exciting dynamic language ...
I am reading all I can find about assets. All suggestions appreciated. Charlie
Samr_small_pragsmall
01 Oct 2011, 22:45
Sam Ruby (634 posts)

If you are developing using Rails 3.1, you will need to use the rails31 version of the seed script:

http://media.pragprog.com/titles/rails4/code/rails31/depot_b/db/seeds.rb

Generic-user-small
03 Oct 2011, 21:44
Michael Cochran (1 post)

I think he actually found an error in the book, because I just hit this myself when using the seeds.rb linked to in the book. I have the book (Rails 3.1 version for sure since the next page is about SASS) and the link in the PDF file (page 71) is to the Rails 3.0 version.

Link in the book: http://media.pragprog.com/titles/rails4/code/depot_b/db/seeds.rb

Real link: http://media.pragprog.com/titles/rails4/code/rails31/depot_b/db/seeds.rb

Samr_small_pragsmall
04 Oct 2011, 01:56
Sam Ruby (634 posts)

Yup, others have reported it too. Sorry about that, this will be corrected in the next update.

Generic-user-small
21 Feb 2012, 00:50
LED (3 posts)

try assets/image.jpg instead of app/assets/images/image.jpg

You must be logged in to comment