Sha256: f0ce8e3259f83668d5d94e687017ea7e2262bedeb2fcedab81c686f36edab53c
Contents?: true
Size: 974 Bytes
Versions: 11
Compression:
Stored size: 974 Bytes
Contents
<% def presenter_by_col(attribute) type = model.columns_hash[attribute.to_s].type return 'item.user.try(:name)' if [:user_id, :user].include?(attribute.to_sym) case type when :date, :datetime, :time "pretty_data item.#{attribute}" when :boolean "color_bool item.#{attribute}" else "item.#{attribute}" end end -%> %table.table.table-striped.index_table#list %thead %tr.pjax_links = batch_action_toggle <% attrs = model_instance.attributes.keys.without(*(translated_columns + %w(updated_at)).map(&:to_s)) -%> <% attrs.each do |attribute| -%> %th= sort_link(@search, :<%= attribute -%>) <% end -%> %th=t 'admin.table.actions' %tbody - collection.each do |item| %tr = batch_action_item(item) %td= id_link(item) <% attrs.without('id').each do |attribute| -%> %td= <%= presenter_by_col(attribute) %> <% end -%> %td.actions= item_index_actions(item)
Version data entries
11 entries across 11 versions & 1 rubygems