small medium large xlarge

10 Jun 2008, 16:10
Paul Johnston (3 posts)


Been working my way through the depot application got to page 91 and it works fine except the alt tag for the images appears, not the actual images. Looking at the source in Firefox it shows


All the images are appended with ?string_of_digits

These are not in my migration file (see below)

</p>}, :image_url => ‘/images/svn.jpg’, :price => 28.50) # . . .

Nor in the filenames(ditto)

-rw-r–r– 1 paulj paulj 307 Jun 10 16:20 auto.jpg -rw-r–r– 1 paulj paulj 307 Jun 10 16:20 logo.png -rw-r–r– 1 paulj paulj 306 Jun 10 16:21 pvg.jpg -rw-r–r– 1 paulj paulj 6646 Jun 10 09:36 rails.png -rw-r–r– 1 paulj paulj 306 Jun 10 16:21 svn.jpg -rw-r–r– 1 paulj paulj 308 Jun 10 16:21 utc.jpg

Any idea where the crud is coming from :-)

Cheers Paul

11 Jun 2008, 09:01
Paul Johnston (3 posts)

Just a little follow up whilst the migration file looks fine the actual database has:

8|Pragmatic Version Control|<p> This book is a recipe-based approach to using Subversion that will get you up and running quickly—and correctly. All projects need version control: it’s a foundational piece of any project’s infrastructure. Yet half of all project teams in the U.S. don’t use any version control at all. Many others don’t use it well, and end up experiencing time-consuming problems. </p>|/images/svn.jpg|2008-06-10 15:17:59|2008-06-10 15:17:59|28.5

Seems a couple of time stamps are being inserted between the descriptions and the prices!

Cheers Paul

11 Jun 2008, 14:27
Sam Ruby (633 posts)

The timestamps are normal, and not a problem. The web server knows to treat the data after a “?” as a a query string, and this generally is ignored when serving static images. Rails uses this to improve the effect of caching… the browser won’t re-request images it already has, and rails signals that the image has changed (something that should happen infrequently) by changing the query argument.

You should be able to see the images by simply visiting http://rubymac:3000/images/auto.jpg. But I suspect that you won’t. Make sure that these images are in the public/images directory and that that directory is readable and executable by your web server.

12 Jun 2008, 11:10
Paul Johnston (3 posts)

Err Thanks!

Won’t embarrass myself by saying what I had done, suffice to say using a Mac for the first time :-) The database was fine it was just what the actual contents of the “graphics” files were!

Working fine thanks to your help Chapter 7 here I come

Cheers Paul

You must be logged in to comment