Skip to content

Instantly share code, notes, and snippets.

View amleaver's full-sized avatar

Alex Leaver amleaver

View GitHub Profile

Keybase proof

I hereby claim:

  • I am amleaver on github.
  • I am amleaver (https://keybase.io/amleaver) on keybase.
  • I have a public key whose fingerprint is 5D13 43A9 42BA A258 B420 2F52 292A 6D36 55C0 164E

To claim this, I am signing this object:

@amleaver
amleaver / _object_as_table.html.erb
Created April 12, 2015 18:04
Rails partial for an object as an HTML table
<!--
Renders an object as an HTML table (developed under Rails 4.0).
locals:
* object: The object to render
* ignore (optional): array of symbols which map to object attributes which won't be rendered in the table
* calls (optional): array of strings which map to methods to call against the object
* table_class (optional): class value to use for the table
* table_id (optional): id to use for the table
* style (optional): style value to use for the table
@amleaver
amleaver / _collection_as_table.html.erb
Last active August 29, 2015 14:19
Rails partial for rendering collections as an HTML table
<!--
Renders a collection of objects in an HTML table (developed under Rails 4.0).
locals:
* size: The size of the collection (required to determine when to close the table)
* ignore (optional): array of symbols which map to object attributes which won't be rendered in the table
* calls (optional): array of strings which map to methods to call against each object
* table_class (optional): class value to use for the table
* table_id (optional): id to use for the table
* style (optional): style value to use for the table