Sha256: dd56d613b0112efb0b0318eed5abff222be542e1298d5ad61ed89fe4fe91a305

Contents?: true

Size: 737 Bytes

Versions: 18

Compression:

Stored size: 737 Bytes

Contents

module Admin
  class Effective<%= resource.class_name.sub('Effective::', '') %>sDatatable < Effective::Datatable
    datatable do
      order :updated_at

      col :updated_at, visible: false
      col :created_at, visible: false
      col :id, visible: false

<% if resource.belong_tos.present? || resource.has_anys.present? -%>
<% resource.belong_tos.each do |reference| -%>
      col :<%= reference.name %>
<% end -%>
<% resource.has_anys.each do |reference| -%>
      col :<%= reference.name %>
<% end -%>

<% end -%>
<% attributes.except(:created_at, :updated_at, :id).each do |name, _| -%>
      col :<%= name %>
<% end -%>

      actions_col
    end

    collection do
      <%= resource.class_name %>.deep.all
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
effective_developer-0.8.5 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.8.4 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.8.3 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.8.2 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.8.1 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.8.0 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.7.8 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.7.7 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.7.6 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.7.5 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.7.4 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.7.3 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.7.2 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.7.1 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.7.0 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.6.17 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.6.16 lib/scaffolds/admin_effective/datatables/datatable.rb
effective_developer-0.6.15 lib/scaffolds/admin_effective/datatables/datatable.rb