In my 'new' view for an Item object, the user can upload a picture of the item. How can I make the upload optional (while creating the new item)? I'm using REST and this is a portion of what my controller looks like to make it Mandatory to upload an image: respond_to do |format| if @item.save and @photo.save Now if I remove the @photo.save no image will be created (even if it is valid).
on 2007-04-08 07:13
on 2007-04-08 12:12
Okay I figured it out. I assigned the @photo to @item: @item.photo = @photo then: respond_to do |format| if @item.save Attachment_fu is a great plugin!