Sha256: df273c5f7292f659b63fd0990ab29d65e039ce353c5f9128d6868e1af109100a
Contents?: true
Size: 961 Bytes
Versions: 12
Compression:
Stored size: 961 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= list_sort_link(:<%= 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
12 entries across 12 versions & 1 rubygems