如何用Ruby中的img_tag替换glyphicon

时间:2016-01-26 16:32:08

标签: ruby-on-rails image

这是我的代码

<%= render partial: 'negotiations/company_selection_placeholder', locals: {type: 'Removal', company: removal, icon: 'glyphicon glyphicon-home'} %>

这是我要放入的图像而不是图标

<%= image_tag 'askingPrice.svg', class: "imgstage" %>

这里是company_selection_placeholder partial:

<div class="panel panel-default"> 
  <div class="panel-heading">
    <%= type %>
  </div> 
</div>

1 个答案:

答案 0 :(得分:0)

假设您在上面发布的评论是整个部分,您需要这样做:

<%= render partial: 'negotiations/company_selection_placeholder', locals: {type: 'Removal', company: removal} %>

和你的部分:

<div class="panel panel-default"> 
  <div class="panel-heading">
    <%= image_tag 'askingPrice.svg', class: "imgstage" %> <!-- not sure if this is where you need your icon, but you should be able to use CSS to move it around from here -->
    <%= type %>
  </div> 
</div>