With Rails, when i want to use an image in a view, i have to use the tag:
image_tag("myimage.png", ...etc)
in my html.erb. That fine. The result is that a ?1234321323423 is put after the name of the image in the src of the html tag.
if i try to put a regular <img src="xxx.jpg"></img>, the picture is not found!!
My problem is i use a jQuery plugin for a carousel that try to load images from the js source. Since the ?12334234434 is not put at the end of the src, the images dont load.
How can i bypass this issue?
Is there a way to tell Rails to load theses images without the trailing ?12342523343?
Thanks for your precious help.
You don’t have to use
image_tag, but you do have to use the correct path.Chances are very good that your URI looks something like
mysite.com/controller/:id/action, so by usingxxx.jpg, your browser will be looking formysite.com/controller/:id/xxx.jpg.Try using
/images/xxx.jpg.