diff options
author | Matthew Lemon <y@yulqen.org> | 2023-12-17 14:26:17 +0000 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2023-12-17 14:26:17 +0000 |
commit | c84b94a647fb4c068e8be9d0495ff7284f41f168 (patch) | |
tree | d969c75c764436c0478234233597e38e1e29c2d5 /app/views/events/_form.html.erb |
Initial
Diffstat (limited to 'app/views/events/_form.html.erb')
-rw-r--r-- | app/views/events/_form.html.erb | 27 |
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 %> |