奇妙なエラーが発生します
ActionView::Template::Error (wrong argument type nil (expected Fixnum)):
この行で:
<%= (!attach.file_size.nil?) ? "(#{number_to_human_size(attach.file_size.to_i).to_s})": "" %>
これが私のコードです:
<% 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 %>
問題がどこにあるのかわかりません。お願い助けて。ありがとう!