Validate vote title
This commit is contained in:
parent
4ad1c4cb86
commit
78abcce758
3 changed files with 44 additions and 10 deletions
|
|
@ -1,5 +1,13 @@
|
|||
<h1 class="mb-5"><%= _("New vote") %></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/new" method="post">
|
||||
<div class="mb-3">
|
||||
<label for="title" class="form-label"><%= _("Title") %></label>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue