Sha256: fe0dd95cedb7ddc5baef8ffddc51fd11f2c66b6b5dae4f957f9443edbc98f1ec

Contents?: true

Size: 1.38 KB

Versions: 22

Compression:

Stored size: 1.38 KB

Contents

-#= page_title :index, <%= class_name %>

table.with-selection
  thead
    tr
<% for attribute in attributes -%>
      th= <%= class_name %>.human_attribute_name(:<%= attribute.name %>)
<% end -%>
      th.actions
  tbody
    - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
      tr data-record={id: <%= singular_table_name %>.id}.to_json
<% for attribute in attributes[0...1] -%>
        td= link_to <%= singular_table_name %>.<%= attribute.name %>, <%= singular_table_name %>
<% end -%>
<% for attribute in attributes[1..-1] -%>
        td= <%= singular_table_name %>.<%= attribute.name %>
<% end -%>
        td.actions
          = link_to content_tag(:span, '', class: 'icon'), <%= singular_table_name %>, class: 'table-new-button'
          = link_to content_tag(:span, '', class: 'icon'), edit_<%= singular_table_name %>_path(<%= singular_table_name %>), class: 'table-edit-button'
          = link_to content_tag(:span, '', class: 'icon'), <%= singular_table_name %>, method: :delete, class: 'table-destroy-button', data: { confirm: 'Are you sure?' }

.page-links
  button.actions-button onclick="window.location = $(this).data('url') + '?' + $.param({ids: MultiSelect.selected_ids()})" data-url=collection_edit_<%= plural_table_name %>_path Actions
  = link_to t('action.new.link', model: <%= class_name %>.model_name.human), new_<%= singular_table_name %>_path, class: 'record-new-button'

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
record_collection-0.10.4 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.10.3 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.10.2 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.10.1 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.10.0 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.9.2 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.9.1 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.9.0 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.8.3 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.8.2 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.8.1 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.7.5 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.7.4 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.7.3 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.7.2 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.7.1 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.7.0 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.6.1 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.6.0 lib/generators/collection_scaffold/templates/index.html.slim
record_collection-0.5.3 lib/generators/collection_scaffold/templates/index.html.slim