%h1= @page_title

- if can?(:new, <%= class_name %>)
  %p.text-right= link_to 'New <%= human_name %>', <%= new_path %>, class: 'btn btn-primary'

- if @datatable.present?
  = render_datatable_scopes(@datatable)
  = render_datatable(@datatable)
- else
  %p There are no <%= plural_name %>.

%h1= @page_title

<%- if actions.include?('new') %>
- if can?(:new, <%= class_name %>)
  %p.text-right= link_to 'New <%= human_name %>', <%= new_path %>, class: 'btn btn-primary'

<% end -%>
- if @datatable.present?
  = render_datatable_scopes(@datatable)
  = render_datatable(@datatable)
- else
  %p There are no <%= plural_name %>.

Hide new button on index if no new action
Hide new button on index if no new action
