Render descriptions as Markdown

This commit is contained in:
ricola 2025-09-27 18:57:36 +02:00
parent 4593bf2b2a
commit 758b01518a
10 changed files with 42 additions and 12 deletions

View file

@ -7,7 +7,7 @@
</p>
<p>
<label for="description"><%= _("Description") %></label>
<input type="text" name="description" value="<%= @vote.description %>">
<textarea type="text" name="description"><%= @vote.description %></textarea>
</p>
<button type="submit"><%= _("Save") %></button>
</form>
@ -16,7 +16,7 @@
<% @vote.candidates.each do |candidate| %>
<h3><%= candidate.name %></h3>
<p><%= candidate.description %></p>
<%= markdown(candidate.description) %>
<form action="/votes/<%= @vote.secure_id %>/candidates/<%= candidate.id %>/delete" method="post">
<button type="submit"><%= _("Delete") %></button>
</form>
@ -31,7 +31,7 @@
</p>
<p>
<label for="description"><%= _("Description") %></label>
<input type="text" name="description">
<textarea type="text" name="description"></textarea>
</p>
<button type="submit"><%= _("Add candidate") %></button>
</form>