<% @promotion.build_image if !@promotion.image %>

<%= f.field_container :image do %>
  <%= f.label :image %><br/>

  <%= f.fields_for :image, @promotion.image do |image_form| %>
    <% if !image_form.object.new_record? %>
      <%= image_tag(image_form.object.attachment.url(:mini)) %>
      <%= link_to_remove_fields t("remove"), image_form %>
      <br />
    <% end %>

    <%= image_form.file_field :attachment %>
  <% end %>
<% end %>

<% @promotion.build_image if !@promotion.image %>

<%# FIXME: disable upload for new records  %>
<%- unless @promotion.new_record? %>
<%= f.field_container :image do %>
  <%= f.label :image %><br/>

  <%= f.fields_for :image, @promotion.image do |image_form| %>
    <% if !image_form.object.new_record? %>
      <%= image_tag(image_form.object.attachment.url(:mini)) %>
      <%= link_to_remove_fields t("remove"), image_form %>
      <br />
    <% end %>

    <%= image_form.file_field :attachment %>
  <% end %>
<% end %>
<% end %>

Disable upload for new records
Disable upload for new records
