39 lines
1.5 KiB
Plaintext
39 lines
1.5 KiB
Plaintext
<%= form_with(model: reservation, class: "contents") do |form| %>
|
|
<% if reservation.errors.any? %>
|
|
<div id="error_explanation" class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-lg mt-3">
|
|
<h2><%= pluralize(reservation.errors.count, "error") %> prohibited this reservation from being saved:</h2>
|
|
|
|
<ul>
|
|
<% reservation.errors.each do |error| %>
|
|
<li><%= error.full_message %></li>
|
|
<% end %>
|
|
</ul>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div class="my-5">
|
|
<%= form.label :customer_id %>
|
|
<%= form.collection_select :customer_id, @company.customers, :id, :name, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
|
</div>
|
|
|
|
<div class="my-5">
|
|
<%= form.label :team_id %>
|
|
<%= form.collection_select :team_id, @company.teams, :id, :name, prompt: "Select a Team", class:"block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
|
</div>
|
|
|
|
|
|
<div class="my-5">
|
|
<%= form.label :start_time %>`
|
|
<%= form.datetime_field :start_time, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
|
</div>
|
|
|
|
<div class="my-5">
|
|
<%= form.label :end_time %>
|
|
<%= form.datetime_field :end_time, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
|
</div>
|
|
|
|
<div class="inline">
|
|
<%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>
|
|
</div>
|
|
<% end %>
|