Use Rails methods to get map location input IDs

We were manually generating the IDs in order to pass them as data
attributes in the HTML in a component where we don't have access to the
form which has the inputs.

However, these data attributes only make sense when there's a form
present, so we can pass the form as a parameter and use it to get the
IDs.

We can now define a map as editable when there's an associated form,
which makes sense IMHO.
This commit is contained in:
Javi Martín
2023-03-07 19:18:45 +01:00
parent 84fff2e9fb
commit b9518d64e1
9 changed files with 30 additions and 30 deletions

View File

@@ -62,7 +62,6 @@
label: t("proposals.form.map_location"),
help: t("proposals.form.map_location_instructions"),
remove_marker_label: t("proposals.form.map_remove_marker"),
parent_class: "proposal",
i18n_namespace: "proposals" %>
</div>
<% end %>