<% @crud_helper.listing_fields.each do |att| %> <% if !att[:visible_if].nil?%> <% if ((att[:visible_if].class == Proc && !att[:visible_if].call(att)) || (att[:visible_if].class != Proc && !att[:visible_if])) %> <% next %> <% end %> <% end %> <%= I18n.t(att[:sf][:label]) %> <% end %> <% @records.each do |record| %> <% @crud_helper.listing_fields.each do |att| %> <% if record.send(att[:attribute]).present? or record.send(att[:attribute]).to_s == "false"%> <% if @model.columns_hash[att[:attribute].to_s].present? && [:date, :datetime].include?(@model.columns_hash[att[:attribute].to_s].type)%> <% if att[:date_format].present?%> <%= record.send(att[:attribute]).strftime(att[:date_format]) %> <% else %> <%= l record.send(att[:attribute]) %> <% end %> <% elsif ((@model.reflect_on_association(att[:attribute]) && @model.reflect_on_association(att[:attribute]).macro != :belongs_to && @model.reflect_on_association(att[:attribute]).macro != :has_one) || record.send(att[:attribute]).class == Array)%> <%= record.send(att[:attribute]).map{|rec| rec.to_s}.join(",") %> <% else %> <% if record.send(att[:attribute]).to_s == "false" or record.send(att[:attribute]).to_s == "true" %> <%= I18n.t(record.send(att[:attribute]) ? "shared.sim" : "shared.nao") %> <% elsif att[:sf][:label_method].present? %> <%= record.send(att[:attribute]).send(att[:sf][:label_method]).to_s %> <% else %> <%= record.send(att[:attribute]).to_s %> <% end %> <% end %> <% else %> <% end %> <% end %> <% end %>