<% exceptions ||= ['created_at', 'updated_at', 'deleted_at'] %> <% excluded_columns ||= [] %> <% additional_columns ||= [] %> <% additional_actions ||= [] %> <% hide_actions ||= false %> <% sort_fields ||= [] %> <% sort_all ||= false %> <% unless list.empty? %> <% (list.first.class.column_names - exceptions - excluded_columns + additional_columns).each do |column| %> <% if sort_all || sort_fields.include?(column) %> <% if /_id$/ =~ column %> <% elsif /_cents$/ =~ column %> <% elsif /_currency$/ =~ column %> <% else %> <% end %> <% else %> <% if /_id$/ =~ column %> <% elsif /_cents$/ =~ column %> <% elsif /_currency$/ =~ column %> <% else %> <% end %> <% end %> <% end %> <% unless hide_actions %> <% end %> <% list.each do |object| %> <% (list.first.class.column_names - exceptions - excluded_columns + additional_columns).each do |column| %> <% next if /_currency$/ =~ column %> <% end %> <% unless hide_actions %> <% end %> <% end %>
<%= sort_link(@q, column, list.first.class.human_attribute_name(column.split("_id")[0])) %><%= sort_link(@q, column, list.first.class.human_attribute_name(column.split("_cents")[0])) %><%= sort_link(@q, column, list.first.class.human_attribute_name(column)) %><%= list.first.class.human_attribute_name(column.split("_id")[0]) %><%= list.first.class.human_attribute_name(column.split("_cents")[0]) %><%= list.first.class.human_attribute_name(column) %>Ações
<% if object.send(column).class == Date or object.send(column).class == DateTime or object.send(column).class == ActiveSupport::TimeWithZone or object.send(column).class == Time %> <%=l object.send(column) %> <% elsif /_id$/ =~ column && object.respond_to?(column.split('_id')[0]) %> <%= object.send(column.split("_id")[0])&.name %> <% elsif /_cents$/ =~ column %> <%= number_to_currency object.send(column.split("_cents")[0]) %> <% elsif column == 'id' %> <%= link_to object.id, object %> <% else %> <%= object.send(column) %> <% end %> <%= render 'shared/action_links', object: object, additional_actions: additional_actions %>
<% end %>