我做一些字符串切片。現在,我有這樣的事情:導軌 - 切片字符串和導軌路徑
@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