Sha256: 2e9fb100713e41e1b2547f7dad43464ad2e5bc0fe3dcb44b206e5ae841c97af8

Contents?: true

Size: 947 Bytes

Versions: 20

Compression:

Stored size: 947 Bytes

Contents

- resource = (@_effective_resource || Effective::Resource.new(controller_path))

.row
  .col-sm-6
    %h1= @page_title
  .col-sm-6
    %p.text-right
      - if can?(:new, resource.klass) && resource.new_path(check: true).present?
        = link_to "New #{resource.human_name.titleize}", send(resource.new_path), class: 'btn btn-primary'

- if @datatable
  = render_datatable(@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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
effective_resources-0.6.9 app/views/application/index.html.haml
effective_resources-0.6.8 app/views/application/index.html.haml
effective_resources-0.6.7 app/views/application/index.html.haml
effective_resources-0.6.6 app/views/application/index.html.haml
effective_resources-0.6.5 app/views/application/index.html.haml
effective_resources-0.6.4 app/views/application/index.html.haml
effective_resources-0.6.3 app/views/application/index.html.haml
effective_resources-0.6.2 app/views/application/index.html.haml
effective_resources-0.6.1 app/views/application/index.html.haml
effective_resources-0.6.0 app/views/application/index.html.haml
effective_resources-0.5.1 app/views/application/index.html.haml
effective_resources-0.5.0 app/views/application/index.html.haml
effective_resources-0.4.10 app/views/application/index.html.haml
effective_resources-0.4.9 app/views/application/index.html.haml
effective_resources-0.4.8 app/views/application/index.html.haml
effective_resources-0.4.7 app/views/application/index.html.haml
effective_resources-0.4.6 app/views/application/index.html.haml
effective_resources-0.4.5 app/views/application/index.html.haml
effective_resources-0.4.4 app/views/application/index.html.haml
effective_resources-0.4.3 app/views/application/index.html.haml