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 topic?