Sha256: eec561c89af2b82405713bc84df119c48375371521fdaeb7a02db05d08fa10eb

Contents?: true

Size: 918 Bytes

Versions: 6

Compression:

Stored size: 918 Bytes

Contents

- field_map = { :fields => { :position => proc { '<div class="handle">+</div>'.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)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
e9_attributes-0.0.6 app/views/e9_attributes/menu_options/_table.html.haml
e9_attributes-0.0.5 app/views/e9_attributes/menu_options/_table.html.haml
e9_attributes-0.0.4 app/views/e9_attributes/menu_options/_table.html.haml
e9_attributes-0.0.3 app/views/e9_attributes/menu_options/_table.html.haml
e9_attributes-0.0.2 app/views/e9_attributes/menu_options/_table.html.haml
e9_attributes-0.0.1 app/views/e9_attributes/menu_options/_table.html.haml