drhenner/ror_ecommerce

View on GitHub
app/views/admin/merchandise/images/products/_image.html.erb

Summary

Maintainability
Test Coverage
<fieldset class='row <%=  image_form.object.new_record? ? "new_fields" : "fields" %>'>
  <% if !image_form.object.new_record? %>
    <div class='large-4 column'>
      <%= image_tag image_form.object.photo.url(:small) %>
    </div>
  <% end %>
  <div class='large-8 column'>
    <div style='float:right;'>
      <%= remove_child_link('remove', image_form) %>
    </div>
    <label>Position</label>
    <%= image_form.select       :position, [1,2,3,4,5,6] %>

    <label>Caption</label>
    <%= image_form.text_field   :caption %>

    <label>Photo</label>
    <%= image_form.file_field   :photo %>

    <label>Link to image</label>
    <%= image_form.text_field   :photo_from_link %>
  </div>
</fieldset>