iframe form send & ujs

Rails 3 JS helpers is awesome. In Rails 2 I never use it, because it
was be very terrible.

But we still can't send multipart form easy as normal via :remote =>
true.

In my current project I write modification of jQuery UJS (http://
gist.github.com/511578#LID34). It's works well, but I need some
changes in Rails.

I can write gem or patch to Rails, what your think about what?

btw how about automatically set :remote => true to form_for if file
input is presented in form? I'm not sure that there is someone who
wants to be in the form of files without multipart.

I’ve done similar work in our project. What I wanted to do is enable RJS after iframe uploads, too. So I did this hack which renders RJS as javascript string in the iframe which is eval’d in the scope of the main page.

I was thinking that this might be Rails core material. The iframe logic can be handled in rails.js adapters for Prototype and jQuery, and the RJS support can be implemented in ActionController to kick in when it detects that the form submit is being made in an iframe (a special param can be sent to indicate this).

Is anyone interested in this? One potential downside of async file uploads is that there might be cross-browser issues, but on the other hand it would enable multipart forms with files in them to support :remote => true.

@Aleksandr: I don’t see a need to change view helpers like form_for since all this logic and conditionals can be handled purely client-side in rails.js. The only place in Rails which might require a change is RJS, if we follow the hack I showed above.