<%= f.label :image, t("images.form.admin_title") %> <%= link_to_add_association t("images.form.add_new_image"), f, :image, force_non_association_create: true, partial: "images/image_fields", id: "new_image_link", class: "button hollow", render_options: { locals: { imageable: imageable } }, data: { association_insertion_node: "#nested-image", association_insertion_method: "append" } %> <%= render_image(f.object.image, :thumb, false) if f.object.image %>
<%= f.fields_for :image do |image_builder| %>
<%= image_builder.hidden_field :id %> <%= image_builder.hidden_field :user_id, value: current_user.id %> <%= image_builder.hidden_field :cached_attachment %> <%= image_builder.text_field :title, placeholder: t("images.form.title_placeholder"), label: "#{t("images.form.admin_alt_text")}" %>
<%= render_image_attachment(image_builder, imageable, image_builder.object) %>
<% end %>