ruby - How to pass an image to data attributes in rails? -
i integrating template rails. every thing has been set have problem in slider. portion of slider causing problems. passing images assets data attributes 1: data-thumb & 2: data-lazyload says error 404 resource not found.
static template html
<li data-transition="zoomout" data-slotamount="7" data-easein="default" data-easeout="default" data-masterspeed="300" data-thumb="images/slider/bg4.jpg" data-rotate="0" data-saveperformance="off" data-title="slide" data-description="on"> <!-- main image --> <img src="images/dummy.png" alt="laptopmockup_sliderdy" data-lazyload="images/slider/bg1.jpg">
rails template
<li data-transition="zoomout" data-slotamount="7" data- easein="default" data-easeout="default" data-masterspeed="300" data: {thumb: image_path("bg5.jpg")} data-rotate="0" data-saveperformance="off" data-title="slide" data-description="on"> <!-- main image --> <%= image_tag("dummy.png", alt:"laptopmockup_sliderdy", data: { lazyload: 'slider/bg1.jpg'}) %>
i have tried these methods
data-thumb="<%= image_tag('slider/bg4.jpg") data-thumb="<%= image_path('slider/bg4.jpg") data-thumb="<%= asset_path('slider/bg4.jpg")
&
data: {lazyload: 'slider/bg1.jpg'}
but none of work.kindly guide me make correct.
Comments
Post a Comment