Sha256: 3cf0ca60a0d421ebeccd57be09e2a2dac8a9439714a0051facb9d82f31f5e903

Contents?: true

Size: 1.49 KB

Versions: 2

Compression:

Stored size: 1.49 KB

Contents

- content_for :title, t('.title')

- @<%= plural_resource_name %> = @<%= plural_resource_name %>.paginate(page: params[:page], per_page: 50)

.row
  .span12
    - if @<%= plural_resource_name %>.blank?
      %p.alert.alert-notice= t(".empty")
    - else
      %table.table.table-striped
        %thead
          %tr
            <%- columns.each do |column| -%>
            %th= <%= resource_name.classify %>.human_attribute_name(:<%= column.name %>)
            <%- end -%>
            %th= t('.actions')
        %tbody
          - @<%= plural_resource_name %>.each do |<%= resource_name %>|
            %tr
              <%- columns.each do |column| -%>
              %td= <%= resource_name %>.<%= column.name %>
              <%- end -%>
              %td
                = link_to t('.show'), <%= singular_controller_routing_path %>_path(<%= resource_name %>), :class => 'btn btn-mini'
                = link_to t('.edit'), edit_<%= singular_controller_routing_path %>_path(<%= resource_name %>), :class => 'btn btn-mini' if can? :update, <%= resource_name %>
                = link_to t('.destroy'), <%= singular_controller_routing_path %>_path(<%= resource_name %>), :method => :delete, :confirm => t('.confirm'), :class => 'btn btn-mini btn-danger' if can? :destroy, <%= resource_name %>

      = will_paginate @<%= plural_resource_name %>, renderer: BootstrapPagination::Rails

    = link_to t('.new'), new_<%= singular_controller_routing_path %>_path, :class => 'btn btn-primary' if can? :create, <%= model_name %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ouvrages_scaffold-0.2.0 lib/generators/ouvrages/views/templates/index.html.haml
ouvrages_scaffold-0.1.3 lib/generators/ouvrages/views/templates/index.html.haml