Validate vote title

This commit is contained in:
ricola 2025-12-04 01:47:17 +01:00
parent 4ad1c4cb86
commit 78abcce758
3 changed files with 44 additions and 10 deletions

View file

@ -1,5 +1,13 @@
<h1 class="mb-5"><%= _("Edit vote description") %></h1>
<% if @errors %>
<% @errors.each do |error| %>
<% if error.attribute == :title and error.type == :blank %>
<p class="alert alert-warning mb-4"><%= _("Enter a title.") %></p>
<% end %>
<% end %>
<% end %>
<form action="/votes/<%= @vote.secure_id %>/edit" method="post">
<div class="mb-3">
<label for="title" class="form-label"><%= _("Title") %></label>