aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/events/_form.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/events/_form.html.erb')
-rw-r--r--app/views/events/_form.html.erb27
1 files changed, 27 insertions, 0 deletions
diff --git a/app/views/events/_form.html.erb b/app/views/events/_form.html.erb
new file mode 100644
index 0000000..db05a72
--- /dev/null
+++ b/app/views/events/_form.html.erb
@@ -0,0 +1,27 @@
+<%= form_with(model: event) do |form| %>
+ <% if event.errors.any? %>
+ <div style="color: red">
+ <h2><%= pluralize(event.errors.count, "error") %> prohibited this event from being saved:</h2>
+
+ <ul>
+ <% event.errors.each do |error| %>
+ <li><%= error.full_message %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
+ <div>
+ <%= form.label :date, style: "display: block" %>
+ <%= form.date_field :date %>
+ </div>
+
+ <div>
+ <%= form.label :name, style: "display: block" %>
+ <%= form.text_field :name %>
+ </div>
+
+ <div>
+ <%= form.submit %>
+ </div>
+<% end %>