<%= content_tag :tr, id: "record-#{record.id}" do %> <%@crud_helper.index_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%> <% record.send(att[:attribute]).each do |rec| %>
  • <%= rec.to_s %>
  • <% end %> <% elsif record.send(att[:attribute]).respond_to?(:url) and record.send(att[:attribute]).url(:thumb) %> <%= image_tag(record.send(att[:attribute]).url(:thumb)) %> <% else %> <% if record.send(att[:attribute]).to_s == "false" or record.send(att[:attribute]).to_s == "true" %> <%= record.send(att[:attribute]) ? "Sim" : "Não" %> <% else %> <%= record.send(att[:attribute]).to_s %> <% end %> <% end %> <% else %> <% end %> <%end%> <%if @crud_helper.view_action%> Visualizar <%end%> <%if @crud_helper.edit_action%> Editar <%end%> <%if @crud_helper.destroy_action%> Excluir <%end%> <%@crud_helper.actions.each do |a|%> <% if ((a[2].present? && a[2].call(record)) || !a[2].present?) %> <%=a[1]%> <%end %> <%end %> <% end %>