fix for none image
This commit is contained in:
parent
f7530baeca
commit
33e6eec5e3
|
|
@ -1,6 +1,8 @@
|
|||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<% if expert.avatar.attached? %>
|
||||
<%= image_tag expert.avatar, height: 150 %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<% unless expert.avatar.blank? %>
|
||||
<% if expert.avatar.attached? %>
|
||||
<% b64 = open(ActiveStorage::Blob.service.path_for(expert.avatar.key)) { |f| f.read } %>
|
||||
<% b64a = Base64.strict_encode64(b64) %>
|
||||
<img src="data:image/jpeg;base64,<%= b64a %>" height="150px"/>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@
|
|||
<tbody>
|
||||
<% @experts.each do |expert| %>
|
||||
<tr>
|
||||
<td><%= image_tag expert.avatar, height: 20 %></td>
|
||||
<td>
|
||||
<% if expert.avatar.attached? %>
|
||||
<%= image_tag expert.avatar, height: 20 %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= link_to expert.name, expert %></td>
|
||||
<td><%= expert.description %></td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@
|
|||
<tbody>
|
||||
<% @partners.each do |partner| %>
|
||||
<tr>
|
||||
<td><%= image_tag partner.logo, height: 20 %></td>
|
||||
<td>
|
||||
<% if partner.logo.attached? %>
|
||||
<%= image_tag partner.logo, height: 20 %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= link_to partner.name, partner %></td>
|
||||
<td><%= partner.description %></td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@
|
|||
<td>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<% if partner.logo.attached? %>
|
||||
<%= image_tag partner.logo, height: 40 %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<td>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<% unless partner.logo.blank? %>
|
||||
<% if partner.logo.attached? %>
|
||||
<% b64 = open(ActiveStorage::Blob.service.path_for(partner.logo.key)) { |f| f.read } %>
|
||||
<% b64a = Base64.strict_encode64(b64) %>
|
||||
<img src="data:image/jpeg;base64,<%= b64a %>" height="40px"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue