Simplify passing the locale to translatable fields

Creating a new form builder might be too much. My idea was so the view
uses more or less the same syntax it would use with Rails' default
builder, and so we can use `text_field` instead of
`translatable_text_field`.
This commit is contained in:
Javi Martín
2018-10-07 22:13:34 +02:00
parent 71601bd3f8
commit 5cdda12902
2 changed files with 16 additions and 24 deletions

View File

@@ -28,18 +28,16 @@
</div>
<div class="row">
<%= f.translatable_fields do |translations_form, locale| %>
<%= f.translatable_fields do |translations_form| %>
<div class="small-12 medium-6 column">
<%= translations_form.translatable_text_field :title,
locale: locale,
<%= translations_form.text_field :title,
placeholder: t("admin.banners.banner.title"),
data: {js_banner_title: "js_banner_title"},
label: t("admin.banners.banner.title") %>
</div>
<div class="small-12 column">
<%= translations_form.translatable_text_field :description,
locale: locale,
<%= translations_form.text_field :description,
placeholder: t("admin.banners.banner.description"),
data: {js_banner_description: "js_banner_description"},
label: t("admin.banners.banner.description") %>