Simplify imageable/documentable note method names

This commit is contained in:
Javi Martín
2021-07-11 22:03:32 +02:00
parent 67c29a7c5f
commit c9903f36cc
4 changed files with 4 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
<div class="documents-list">
<%= f.label :documents, t("documents.form.title") %>
<p class="help-text"><%= documentables_note %></p>
<p class="help-text"><%= note %></p>
<div id="nested-documents" data-max-documents-allowed="<%= max_documents_allowed %>">
<%= f.fields_for :documents do |documents_builder| %>

View File

@@ -16,7 +16,7 @@ class Documents::NestedComponent < ApplicationComponent
documentable.class.max_documents_allowed
end
def documentables_note
def note
t "documents.form.note", max_documents_allowed: max_documents_allowed,
accepted_content_types: documentable_humanized_accepted_content_types(documentable.class),
max_file_size: max_file_size(documentable.class)

View File

@@ -1,5 +1,5 @@
<%= f.label image_fields, t("images.form.title") %>
<p class="help-text"><%= imageables_note %></p>
<p class="help-text"><%= note %></p>
<div id="nested-image">
<%= f.fields_for image_fields do |image_builder| %>

View File

@@ -13,7 +13,7 @@ class Images::NestedComponent < ApplicationComponent
f.object
end
def imageables_note
def note
t "images.form.note", accepted_content_types: imageable_humanized_accepted_content_types,
max_file_size: imageable_max_file_size
end