- field_map = { :fields => { :position => proc { '
+
'.html_safe }, :value => nil, :key => nil } }
%table.sortable
%thead
%tr
- field_map[:fields].keys.each do |key|
- if key.is_a?(Symbol)
%th= resource_class.human_attribute_name(key)
- else
%th= orderable_column_link(key)
%th= e9_t(:actions)
%tbody
- if collection.empty?
%tr
%td{:colspan => field_map[:fields].length + 1}= e9_t(:no_records_text)
- else
- collection.each do |record|
%tr{:id => "ids_#{record.id}", :class => cycle('odd', 'even')}
- field_map[:fields].each do |key, value|
%td{:class => "record-#{key.to_s.dasherize}"}
= value.respond_to?(:call) ? value.call(record) : record.send(key)
%td.links
= link_to_edit_resource(record)
= link_to_destroy_resource(record)