added parties
This commit is contained in:
42
app/views/parties/_form.html.erb
Normal file
42
app/views/parties/_form.html.erb
Normal file
@ -0,0 +1,42 @@
|
||||
<%= form_with(model: party, class: "contents") do |form| %>
|
||||
<% if party.errors.any? %>
|
||||
<div id="error_explanation" class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-md mt-3">
|
||||
<h2><%= pluralize(party.errors.count, "error") %> prohibited this party from being saved:</h2>
|
||||
|
||||
<ul class="list-disc ml-6">
|
||||
<% party.errors.each do |error| %>
|
||||
<li><%= error.full_message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :title %>
|
||||
<%= form.text_field :title, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": party.errors[:title].none?, "border-red-400 focus:outline-red-600": party.errors[:title].any?}] %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :location %>
|
||||
<%= form.text_field :location, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": party.errors[:location].none?, "border-red-400 focus:outline-red-600": party.errors[:location].any?}] %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :start_date %>
|
||||
<%= form.date_field :start_date, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": party.errors[:start_date].none?, "border-red-400 focus:outline-red-600": party.errors[:start_date].any?}] %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :start_time %>
|
||||
<%= form.time_field :start_time, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": party.errors[:start_time].none?, "border-red-400 focus:outline-red-600": party.errors[:start_time].any?}] %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :status %>
|
||||
<%= form.text_field :status, class: ["block shadow-sm rounded-md border px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": party.errors[:status].none?, "border-red-400 focus:outline-red-600": party.errors[:status].any?}] %>
|
||||
</div>
|
||||
|
||||
<div class="inline">
|
||||
<%= form.submit class: "w-full sm:w-auto rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %>
|
||||
</div>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user