Forum: Ruby on Rails RE: Rails urls & the AWD book

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Steve Chanin (Guest)
on 2006-02-22 19:34
(Received via mailing list)

I remember running into the same problem with the book.  Here is an
errata from the web site ... basically the validation is broken:

#896: The suggested image url is relative /images/sk_auto_small.jpg but
the validation requires a full url starting with http.

(Dave says: I'm going to tidy all that up in the next edition: it was a
change made at the suggestion of a reviewer, but in retrospect I regret



	From: removed_email_address@domain.invalid
[mailto:removed_email_address@domain.invalid] On Behalf Of Bill W.
	Sent: Sunday, February 19, 2006 2:44 PM
	To: removed_email_address@domain.invalid
	Subject: [Rails] Rails urls & the AWD book


	I'm having a hard time understanding the way Rails handles urls.
I'm specifically having real trouble with the image_urls in the Depot
app in the Agile Web D. book.

	If I enter "\image\file.png" in the Add Product page, the image
is displayed in the other views and Properties shows
	If I leave off the leading backslash and enter "image\file.png"
the image does not display and Properties shows
http://localhost:3000/admin/images/file.png when I look at it from the
admin_controller or http://localhost:3000/store/images/file.png when I
look at it from the store_controller.

	In either case, the validation the book shows for image_url
really trips me up because it's checking to see that the string begins
with "http:".  What's up with that?

	Also, when I'm supplying the location in the unit test I'm
having to use a string I really don't understand.  The string is:
	Why do some of the '\' characters have to be escaped and others
not?  Or is that not what's going on?

	Could someone help?  At least point me to some docs on this

This topic is locked and can not be replied to.