Sha256: 7560a282c35e7990bfc23628b26e475e597d2b795a526ef68857faa6c7c05391

Contents?: true

Size: 954 Bytes

Versions: 30

Compression:

Stored size: 954 Bytes

Contents

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

.row
  .col-8
    %h1= @page_title
  .col-4.text-right
    - if EffectiveResources.authorized?(controller, :new, resource.klass) && (path = resource.action_path(:new)).present?
      = link_to "New #{resource.human_name.titleize}", 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

30 entries across 30 versions & 1 rubygems

Version Path
effective_resources-0.9.0 app/views/application/index.html.haml
effective_resources-0.8.26 app/views/application/index.html.haml
effective_resources-0.8.25 app/views/application/index.html.haml
effective_resources-0.8.24 app/views/application/index.html.haml
effective_resources-0.8.23 app/views/application/index.html.haml
effective_resources-0.8.22 app/views/application/index.html.haml
effective_resources-0.8.21 app/views/application/index.html.haml
effective_resources-0.8.20 app/views/application/index.html.haml
effective_resources-0.8.19 app/views/application/index.html.haml
effective_resources-0.8.18 app/views/application/index.html.haml
effective_resources-0.8.17 app/views/application/index.html.haml
effective_resources-0.8.16 app/views/application/index.html.haml
effective_resources-0.8.15 app/views/application/index.html.haml
effective_resources-0.8.14 app/views/application/index.html.haml
effective_resources-0.8.13 app/views/application/index.html.haml
effective_resources-0.8.12 app/views/application/index.html.haml
effective_resources-0.8.11 app/views/application/index.html.haml
effective_resources-0.8.10 app/views/application/index.html.haml
effective_resources-0.8.9 app/views/application/index.html.haml
effective_resources-0.8.8 app/views/application/index.html.haml