Skip to content

Instantly share code, notes, and snippets.

@jparker
Created May 28, 2009 06:40
Show Gist options
  • Save jparker/119140 to your computer and use it in GitHub Desktop.
Save jparker/119140 to your computer and use it in GitHub Desktop.
<!-- day.html.haml -->
<h1>Billables | Daily</h1>
<table>
<thead><%= render :partial => 'head' %></thead>
<tfoot><%= render :partial => 'foot' %></tfoot>
<tbody><%= render :partial => @billables %></tbody>
</table>
<!-- week.html.haml -->
<h1>Billables | Weekly</h1>
<table>
<thead><%= render :partial => 'head' %></thead>
<tfoot><%= render :partial => 'foot' %></tfoot>
<tbody><%= render :partial => @billables %></tbody>
</table>
<!-- month.html.haml -->
<h1>Billables | Monthly</h1>
<table>
<thead><%= render :partial => 'head' %></thead>
<tfoot><%= render :partial => 'foot' %></tfoot>
<tbody><%= render :partial => @billables %></tbody>
</table>
<!-- _head.html.haml -->
<tr>
<th></th>
<th>Date</th>
<th>Vendor</th>
<th>Project</th>
<th>Rate</th>
<th></th>
</tr>
<!-- _foot.html.haml -->
<tr>
<td colspan="4">Total</td>
<td><%= number_to_currency @billables.to_a.sum(&:rate) %></td>
<td></td>
</tr>
<!-- _billable.html.haml -->
<% content_tag_for :tr, billable, :class => cycle('odd', 'even') do %>
<td>
<%= link_to 'view', billable %> |
<%= link_to 'edit', edit_billable_path(billable) %>
</td>
<td><%= billable.date.to_s(:short) %></td>
<td><%= h billable.vendor.name %></td>
<td><%= h billable.project.name %></td>
<td><%= number_to_currency billable.rate %></td>
<td>
<%= link_to 'delete', billable, :method => :delete %>
</td>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment