# Remote\_form\_for file\_field strangeness

**URL:** <https://www.ruby-forum.com/t/remote-form-for-file-field-strangeness/160061>\
**Category:** Rails\
**Created:** [February 11, 2009, 12:36pm UTC](https://www.ruby-forum.com/t/remote-form-for-file-field-strangeness/160061 "2009-02-11T12:36:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tatyree](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f14d63/32.png) [@tatyree](https://www.ruby-forum.com/u/tatyree)\
**Post date:** [February 11, 2009, 12:36pm UTC](https://www.ruby-forum.com/t/remote-form-for-file-field-strangeness/160061/1 "2009-02-11T12:36:36Z")

</div>

Does anyone see any problem with this form?

- form\_remote\_for(Photo.new, :html =\> {:multipart =\> true, :target  
=\> :uploader}) do |f|  
.form\_element  
= f.label :photo  
= f.file\_field :collateral  
= hidden\_field\_tag :container\_id, @shoot.id  
= hidden\_field\_tag :container\_type, @shoot.class.name  
.form\_element  
= f.submit ‘Add Photos’

The photo has a paperclip attachment called collateral, and a double  
polymorphic relation with container (which can be a shoot, model or  
photographer). At the bottom of the page is an iframe with the id and  
name ‘uploader’. However, when submitted via AJAX, it never  
serializes the file\_field: both the development log and firebug both  
only show the hidden params being passed. It works fine as a  
form\_for, however.

I’m using 2.2.2 on OSX 10.5.6 and the responds\_to\_parent plugin to,  
well, respond.

Thanks,  
Todd
