Created
April 19, 2013 00:49
-
-
Save gogogarrett/5417361 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - edit ||= false | |
| %label Search | |
| %input#filter | |
| %hr | |
| %table.footable{"data-filter" => "#filter"} | |
| %thead | |
| %tr | |
| - headers.each_with_index do |header, index| | |
| - if index == 0 | |
| %th{"data-class" => "expand", "data-sort-initial" => "true"} | |
| = header.to_s.humanize | |
| - else | |
| %th | |
| = header.to_s.humanize | |
| - if edit | |
| %td | |
| Actions | |
| %tbody | |
| - collection.each do |obj| | |
| %tr[obj] | |
| - headers.each do |header| | |
| %td | |
| = obj.send(header) | |
| - if edit | |
| %td | |
| %a{href: "/#{obj.class.to_s.underscore.pluralize.to_sym}/#{obj.id}/edit"} | |
| edit | |
| %hr | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| = render partial: "shared/grid", locals: { collection: @school_classes.to_a, headers: [:name], edit: true } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment