Reputation: 45
I need this expression but using image_tag otherwise the images are not being displayed in production after Capistrano deployment.
<li data-thumb="slide1-thumb.jpg">
<img src="slide1.jpg" />
</li>
I tried something like
<li data-thumb="<%= image_tag "slide1-thumb.jpg" %>">
<%= image_tag "slide1-thumb.jpg" %>
</li>
but is not working. any idea? I can't find anything on google.. thank you
Upvotes: 1
Views: 1018
Reputation: 33460
You could use asset_path
to refer an image within your app/assets/images
path, like:
<li data-thumb="<%= asset_path 'slide1-thumb.jpg' %>">
<%= image_tag 'slide1-thumb.jpg' %>
</li>
image_tag
helper will create an img
tag inside the thumb
data attribute, so you can print just the resource needed.
Upvotes: 1