<%# Copyright (C) 2024 Manuel Bustillo %>

<%= form_with(model: guest) do |form| %>
  <% if guest.errors.any? %>
    <div style="color: red">
      <h2><%= pluralize(guest.errors.count, "error") %> prohibited this guest from being saved:</h2>

      <ul>
        <% guest.errors.each do |error| %>
          <li><%= error.full_message %></li>
        <% end %>
      </ul>
    </div>
  <% end %>

  <div>
    <%= form.label :first_name, style: "display: block" %>
    <%= form.text_field :first_name %>
  </div>

  <div>
    <%= form.label :last_name, style: "display: block" %>
    <%= form.text_field :last_name %>
  </div>

  <div>
    <%= form.label :email, style: "display: block" %>
    <%= form.text_field :email %>
  </div>

  <div>
    <%= form.label :phone, style: "display: block" %>
    <%= form.text_field :phone %>
  </div>

  <div>
    <%= form.submit %>
  </div>
<% end %>