% exceptions ||= ['created_at', 'updated_at', 'deleted_at'] %> <% excluded_columns ||= [] %> <% additional_columns ||= [] %> <% additional_actions ||= [] %> <% hide_actions ||= false %> <% sort_fields ||= [] %> <% sort_all ||= false %> <% unless list.empty? %>
<%= sort_link(@q, column, list.first.class.human_attribute_name(column.split("_id")[0])) %> | <% elsif /_cents$/ =~ column %><%= sort_link(@q, column, list.first.class.human_attribute_name(column.split("_cents")[0])) %> | <% elsif /_currency$/ =~ column %> <% else %><%= sort_link(@q, column, list.first.class.human_attribute_name(column)) %> | <% end %> <% else %> <% if /_id$/ =~ column %><%= list.first.class.human_attribute_name(column.split("_id")[0]) %> | <% elsif /_cents$/ =~ column %><%= list.first.class.human_attribute_name(column.split("_cents")[0]) %> | <% elsif /_currency$/ =~ column %> <% else %><%= list.first.class.human_attribute_name(column) %> | <% end %> <% end %> <% end %> <% unless hide_actions %>Ações | <% end %>
---|---|---|---|---|---|---|
<% 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 %> | <% end %> <% unless hide_actions %><%= render 'shared/action_links', object: object, additional_actions: additional_actions %> | <% end %>