Reputation: 35
I'm following a tutorial: http://tutorials.jumpstartlab.com/projects/merchant.html, where we call product images like this:
<%= image_tag "products/#{product.image_url}" %>
That should work, but I get this 404 error, and this shows up in the console:
GET http://localhost:3000/images/products/%20purple_grapes.jpg
What is that %20 in there. When I hard code the image name, it works. Rails is looking in the right place for the image, which is /assets/images/products/ but the file name should be purple_grapes.jpg, not %20purple_grapes.jpg
This problem is driving me batty. I've done this kind of code before calling images and not had this problem. Any idea why this isn't working? I read through The Assets Pipline and according to it this code is correct.
Thank you!
Upvotes: 0
Views: 43