Perelan
Perelan

Reputation: 406

Image_tag and turbolink

I started my journey with Rails and Ruby a couple of days ago and so far it is going well and I'm loving it!

Though, I do have a minor concern that I cannot find a solution to. I've had a minor sneak peek on turbolink and how that is embedded with Rails. But, my question (problem?) is that whenever I import/include an image (which is located in app/assets/image) with Rails image_tag(...), that image is reloaded whenever I redirect to another page. But if I use <img src="..." whereas the src is an extern link (image fetched from another page) it is not being re-fetched (meaning, it's cached when I redirect to another page).

So my question is: is there a special way to apply turbolink to image_tag?

Thanks.

Upvotes: 0

Views: 226

Answers (1)

Brad
Brad

Reputation: 8668

This is because you are running in development mode. Rails uses an "Asset Pipeline. When in development environment it reloads the assets.

When you come to production, you will see the difference.

You can read more about it here: http://guides.rubyonrails.org/asset_pipeline.html

Upvotes: 2

Related Questions