Simplify getting imageable/documentable in forms

The imageable/documentable object is always the object the form builder
is based on; since we're already passing the form builder, we don't have
to pass the object as well.

The only exception are the poll answers. In this case, we're passing a
new answer as the object. That's OK; the same hack that we're using to
send the data to the answer URL without displaying existing attachments
causes the form to keep working the same way.
This commit is contained in:
Javi Martín
2021-07-11 20:45:57 +02:00
parent ac495e7523
commit 629df5ab9b
14 changed files with 20 additions and 17 deletions

View File

@@ -1,3 +1,5 @@
<% documentable = f.object %>
<div class="documents-list">
<%= f.label :documents, t("documents.form.title") %>
<p class="help-text"><%= documentables_note(documentable) %></p>