How to edit an image_tag url from Ruby File class -
i have image_tag trying trim from.
<%= link_to (image_tag (file.absolute_path(image))), image[/\/.*/]%> it returns:
http://x.x.x.x/opt/ror/dist_portal/public/files/... i need remove "/opt/ror/dist_portal/public" image_tag url, has this:
http://x.x.x.x/files/... how do this?
thank you
<% image_path = ["/", file.dirname(image).split("/").last,"/", file.basename(image)].join('') %> <%= link_to image_tag(image_path), image[/\/.*/]%>
Comments
Post a Comment