Skip to content

Instantly share code, notes, and snippets.

@texel
Created March 9, 2009 18:36
Show Gist options
  • Save texel/76410 to your computer and use it in GitHub Desktop.
Save texel/76410 to your computer and use it in GitHub Desktop.
<%
# table_for @discount_codes do |table|
# table.column :id, :label => 'ID'
# table.column :code
# table.column :max_uses, :label => 'Maximum Uses' do |discount_code|
# discount_code.max_uses || 'Unlimited'
# end
# end
# would generate something like this...
%>
<div class="table">
<table cellspacing="0" cellpadding="0">
<colgroup>
<col class="id">
<col class="code">
<col class="max_uses">
</colgroup>
<thead>
<tr>
<th>ID</th>
<th>Code</th>
<th>Maximum Uses</th>
</tr>
</thead>
<tbody>
<tr class="">
<td>12</td>
<td>nonprofit1</td>
<td>1</td>
</tr>
</tbody>
</table>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment