Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<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