1
我有這樣的代碼:未定義的方法 '+' 的無級
<% @accessories.each do |accessory|%>
<div>
<%= image_tag(accessory.firebrick_qcg.url , :"title" => accessory.part_number , :"alt" => accessory.description , :"data-size" => accessory.width.to_s + "," + accessory.height , :"data-size2" => accessory.width2.to_s + "," + accessory.height2 , :"data-img1" => accessory.firebrick_qcg.url , :"data-img2" => accessory.firebrick_qcr.url, :"data-img3" => accessory.firebrick_rg.url , class: "img-responsive") %>
</div>
<% end %>
我得到這個錯誤:
ActionView::Template::Error (undefined method `+' for nil:NilClass):
Ican't看到什麼是錯的。如果有人能幫助我。
似乎你已經通過'nil'到'image_tag'請用'哪個參數進行評估,以零 –