Skip to content

Instantly share code, notes, and snippets.

@listenlight
Created April 21, 2010 00:08
Show Gist options
  • Save listenlight/373252 to your computer and use it in GitHub Desktop.
Save listenlight/373252 to your computer and use it in GitHub Desktop.
- form_for @demo, :html => { :multipart => true } do |f|
= f.error_messages
%p
= f.label :name
%br
= f.text_field :name
- f.fields_for :images do |builder|
%p
- if builder.object.new_record?
= builder.label :image, "Image"
= builder.file_field :image
- else
= image_tag f.demo.image.url(:thumb) # ???
- unless builder.object.new_record?
= builder.check_box :_destroy
= builder.label :_destroy, "Remove"
%p
= submit_tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment