I need to get a relative url in the data-original
attribute of img
tag like this:
<img data-original="../imf/72932.png" src="../i/72932.jpg" />
But I'm getting
<img data-original="/imf/10163.jpg" src="../i/10163.jpg" />
As you can see, by setting set :relative_links, true
in config.rb
I can get a relative link in img
's src
but not in the data-original
attribute with:
<%= image_tag img_url, { "data-original" => original_path } %>
where original-path
is defined like this
<% original-path = "/imf/#{ wiz.file }" %>
It works of course when the site is generated dynamically in development but not when it is built statically. Is there any way to make original_path
work like a relative path?