I get a weird error
ActionView::Template::Error (wrong argument type nil (expected Fixnum)):
In this line:
<%= (!attach.file_size.nil?) ? "(#{number_to_human_size(attach.file_size.to_i).to_s})": "" %>
Here is my code:
<% if !pr.attachments.empty? %>
<ul class="attached_files">
<% pr.attachments.each do |attach| %>
<li><a href="<%= attach.path_url%> " target="_blank"><%= attach.path_identifier%></a>
<%= (!attach.file_size.nil?) ? "(#{number_to_human_size(attach.file_size.to_i).to_s})": "" %>
</li>
<%end%>
</ul>
<% end %>
I do not understand where the problem is. Help me please. Thank!
source
share