Skip to content

Instantly share code, notes, and snippets.

@maxim
Created February 8, 2009 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxim/60210 to your computer and use it in GitHub Desktop.
Save maxim/60210 to your computer and use it in GitHub Desktop.
<% form_for setup_prototype(@prototype), :html => {:multipart => true} do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :title %><br />
<%= f.text_field :title %>
</p>
<p>
<%= image_tag @prototype.item_view.picture.url(:small) unless @prototype.new_record? %>
<%= f.label :item_view %><br />
<% f.fields_for :item_view do |item_view_form| %>
<%= item_view_form.file_field :picture %>
<% end %>
</p>
<p>
<%= f.label :surface_views %>
<% f.fields_for :surface_views do |surface_view_form| %>
<div>
<%= surface_view_form.label :description, 'Title' %>
<%= surface_view_form.text_field :description, :size => 15 %>
<%= surface_view_form.label :picture %>
<%= surface_view_form.file_field :picture %>
<% unless surface_view_form.object.new_record? %>
<%= image_tag surface_view_form.object.picture.url(:small) %>
<%= surface_view_form.label :_delete, 'Remove:' %>
<%= surface_view_form.check_box :_delete %>
<% end %>
</div>
<% end %>
</p>
<p>
<%= f.submit @prototype.new_record? ? "Create" : "Update" %>
</p>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment