Forum: Ruby on Rails remote_form_for file_field strangeness

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
801e733ad01e7b775dde54cfbded33ba?d=identicon&s=25 tatyree (Guest)
on 2009-02-11 12:36
(Received via mailing list)
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
This topic is locked and can not be replied to.