Sha256: 45fc3516e2489657bd54bf965d05bf47782416f4e0bbb76bc2728ee89f07aeea

Contents?: true

Size: 845 Bytes

Versions: 3

Compression:

Stored size: 845 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)
  = render instance_variable_get('@' + resource.plural_name)

- elsif instance_variable_get('@' + resource.name)
  = 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.plural_name}, or @#{resource.name}.
  %p or include Effective::CrudController in your controller

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
effective_resources-0.4.2 app/views/application/index.html.haml
effective_resources-0.4.1 app/views/application/index.html.haml
effective_resources-0.4.0 app/views/application/index.html.haml