<% exceptions ||= ['created_at', 'updated_at', 'deleted_at'] %> <% excluded_columns ||= [] %> <% additional_columns ||= [] %> <% additional_actions ||= [] %> <% hide_actions ||= false %> <% sort_fields ||= [] %> <% sort_all ||= false %> <% table_class ||= 'datatables' %> <% show_columns ||= [] %> <% hide_read_action ||= false %> <% hide_edit_action ||= false %> <% hide_destroy_action ||= false %> <% if show_columns.empty? %> <% show_columns = list.klass.column_names - exceptions - excluded_columns + additional_columns %> <% end %> <% show_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| %> <% show_columns.each do |column| %> <% next if /_currency$/ =~ column %> <% end %> <% unless hide_actions %> <% end %> <% end %>
<%= sort_link(@q, column, list.klass.human_attribute_name(column.split("_id")[0])) %><%= sort_link(@q, column, list.klass.human_attribute_name(column.split("_cents")[0])) %><%= sort_link(@q, column, list.klass.human_attribute_name(column)) %><%= list.klass.human_attribute_name(column.split("_id")[0]) %><%= list.klass.human_attribute_name(column.split("_cents")[0]) %><%= list.klass.human_attribute_name(column) %>Ações
<% if object.respond_to?(column) && ( 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 /_currency$/ =~ column %> <% elsif column.include?(".") %> <%= eval("object.#{column}") %> <% elsif column == 'id' %> <%= link_to object.id, object %> <% else %> <%= object.send(column) %> <% end %> <%= render 'shared/action_links', object: object, additional_actions: additional_actions, hide_read_action: hide_read_action, hide_edit_action: hide_edit_action, hide_destroy_action: hide_destroy_action %>