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

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -