Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %h1= "Listing " + "#{resource_name}s"
- .btn-group.pull-right
- = link_to "All #{resource_name(item: resource_class.superclass)}s", polymorphic_path([:admin, resource_class.superclass]), class: 'btn'
- = link_to "Add #{resource_name}", new_resource_path, class: 'btn-primary btn'
- %br
- %br
- %table.table.table-bordered.table-striped#sortable{:data => {update_url: polymorphic_path([:sort, :admin, resource_class])}}
- %thead
- %tr
- - attributes.each do |attr|
- %th= resource_class.human_attribute_name(attr)
- %th
- %tbody
- - collection.each do |resource|
- %tr{data: {item_id: "#{resource.id}"}}
- - attributes.each do |attr|
- %td= resource.public_send(attr).to_s.truncate(20)
- %td
- = link_to 'show', resource_path(resource), :class => 'btn'
- = link_to 'edit', edit_resource_path(resource), :class => 'btn btn-primary'
- = link_to 'destroy', resource_path(resource), method: :delete, confirm: "Are you sure?", :class => 'btn btn-danger'
Add Comment
Please, Sign In to add comment