我做一些字符串切片。现在,我有这样的事情:导轨 - 切片字符串和导轨路径
@str = '/images00.someother.path_to_.image.jpg' ///my spliced string
当我这样做:
@new_string = @str[[email protected]]
我认为我将有串状:
'images00.someother.path_to_.image.jpg'
但没有...轨放在url路径图像,所以输出是:
<img src='/images/images00.someother.path_to_.image.jpg'>
当我切片更像它看起来像'images/age01 ...等
我怎样才能删除这个默认路径,但只有在控制器中的这个动作?
VIEW:
<% @array.each do |a| %>
<%= image_tag(a, :id => 'image_' %>
可以粘贴的所有代码的相关位:创建图像视图片段标记+使用那里变量的声明? – BroiSatse
我明白,image_tag把/图像/路径.. hm – Wordica