Skip to content

Instantly share code, notes, and snippets.

@vlad-shatskyi
Forked from anonymous/index.html.erb
Created February 8, 2013 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlad-shatskyi/4740980 to your computer and use it in GitHub Desktop.
Save vlad-shatskyi/4740980 to your computer and use it in GitHub Desktop.
<table style="float: left; margin-left: 20px;">
<% if @user == current_user %>
<caption>My Holidays</caption>
<thead>
<tr>
<th>Start Date</th>
<th>End Date</th>
<th>Description</th>
<th>State</th>
<th>Type</th>
<th>Cancel</th>
</tr>
</thead>
<% current_user.holidays.each do |holiday| %>
<tr>
<td>
<% holiday.start_at.strftime("%d %B %Y") %></td>
<td>
<% holiday.end_at.strftime("%d %B %Y") %></td>
<td>
<% holiday.description %></td>
<td>
<% holiday.state %></td>
<td>
<% holiday.type.try(:name) %></td>
</tr>
<% end %>
<% if current_user.holidays.empty? %>
<tr>
<td>No bookings found</td>
</tr>
<% end %>
</thead>
</table>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment