Display table arrangements
This commit is contained in:
parent
77be7d505a
commit
45974fcf7e
@ -5,5 +5,6 @@ class TablesArrangementsController < ApplicationController
|
||||
|
||||
def show
|
||||
@tables_arrangement = TablesArrangement.find(params[:id])
|
||||
@seats = @tables_arrangement.seats.includes(:guest).group_by(&:table_number)
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,16 @@
|
||||
<h1>ID: <%= @tables_arrangement.id %></h1>
|
||||
|
||||
<p>Discomfort: <%= @tables_arrangement.discomfort %></p>
|
||||
|
||||
<h2>Seats</h2>
|
||||
|
||||
<% @seats.each do |table_number, seats| %>
|
||||
|
||||
<h3>Table <%= table_number %></h3>
|
||||
|
||||
<ul>
|
||||
<% seats.each do |seat| %>
|
||||
<li><%= seat.guest.full_name %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
Loading…
x
Reference in New Issue
Block a user