<% exceptions ||= ['id', 'created_at', 'updated_at', 'deleted_at'] %> <% excluded_columns ||= [] %> <% hide_actions ||= false %> <% sort_fields ||= [] %> <% form_fields ||= (list.first.class.respond_to?('form_fields') ? list.first.class.form_fields : {}) %> <% form_ordered_fields ||= (form_fields.empty? ? list.first.class.column_names : form_fields.keys) %> <% unless list.empty? %> <% (form_ordered_fields - exceptions - excluded_columns).each do |column| %> <% if sort_fields.include?(column) || sort_fields.include?(column.to_s) || sort_fields.include?(column.to_sym) %> <% if /_id$/ =~ column %> <% else %> <% end %> <% else %> <% if /_id$/ =~ column %> <% else %> <% end %> <% end %> <% end %> <% unless hide_actions %> <% end %> <% end %> <% list.each do |object| %> <% (form_ordered_fields - exceptions - excluded_columns).each do |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)) %><%= list.first.class.human_attribute_name(column.split("_id")[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 %> <% else %> <%= object.send(column) %> <% end %> <%= render 'shared/action_links', object: object %>