Simplify generating form fields with labels

Instead of generating the label and then a field without a label, we can
directly generate a field with a label.
This commit is contained in:
Javi Martín
2019-10-02 23:27:48 +02:00
parent 42dbbf5507
commit 3ea9f3cecf
31 changed files with 109 additions and 141 deletions

View File

@@ -13,11 +13,9 @@
</div>
<div class="small-12 medium-3 column">
<label><%= t("admin.poll_shifts.new.task") %></label>
<%= f.select :task,
Poll::Shift.tasks.map { |k, v| [t("admin.poll_shifts.#{k}"), k] },
{ prompt: t("admin.poll_shifts.new.select_task"),
label: false },
{ prompt: t("admin.poll_shifts.new.select_task"), label: t("admin.poll_shifts.new.task") },
class: "js-poll-shifts" %>
</div>