Skip to content

Instantly share code, notes, and snippets.

@gogogarrett
Created April 19, 2013 00:49
Show Gist options
  • Select an option

  • Save gogogarrett/5417361 to your computer and use it in GitHub Desktop.

Select an option

Save gogogarrett/5417361 to your computer and use it in GitHub Desktop.
- 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
= 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