- resource = (@_effective_resource || Effective::Resource.new(controller_path)) - if @datatable - content_for :datatable do = render_datatable(@datatable, charts: false) - content_for :datatable_charts do - keys = @datatable._charts.keys - ks = keys.size - if ks.positive? %br .row - @datatable._charts.keys.each do |k| %div{ class: "#{col_class_num('xl', ks, 3)} #{col_class_num('lg', ks, 2)} #{col_class_num('md', ks, 6)} #{col_class_num('sm', ks, 6)}"} .card.card-primary .card-header %h3.card-title= I18n.t([@datatable.class.name.underscore, 'charts', k].join('.')) .card-tools.text-right %button.btn.btn-tool{ type: :button, 'data-card-widget': :maximize } %i.fas.fa-expand .card-body{ style: 'min-height: 220px' } = render_datatable_chart(@datatable, k) = content_for :datatable_charts .row .col-12 .card.card-primary .card-header %h3.card-title= @page_title .card-tools = resource_form_actions(@context.route_builder, resource.klass, for_action: :index) .card-body - if @datatable = content_for :datatable - elsif instance_variable_get('@' + resource.plural_name).respond_to?(:to_partial_path) = render instance_variable_get('@' + resource.plural_name) - elsif instance_variable_get('@' + resource.name).respond_to?(:to_partial_path) = render instance_variable_get('@' + resource.name) - elsif Rails.env.development? %p effective_resources index view is not sure what to render. %p Define an @datatable, @#{resource.try(:plural_name) || 'a plural'}, or @#{resource.try(:name) || 'a singular'}. %p or include Effective::CrudController in your controller -# .card-footer - begin = render partial: 'index_additional' - rescue ActionView::MissingTemplate - Rails.logger.debug "did not find additional index partial"