[ANN] form_remote_upload plugin


#1

form_remote_tag does not support the input type=file. This is due to
javascript security limitations. I created a plugin that modifies
form_remote_tag so that if you pass it the option: :html =>
{:multipart => true}, it will submit via an iframe, allowing you to
upload files. It works nicely with file_column :). Currently, it
only works with RJS templates (no :update option), and I only
implemented the :loading callback. Patches are welcome to flesh out
the functionality, but I’m sharing it now because it’s still quite
useful.

http://svn.kylemaxwell.com/form_remote_upload/trunk

Patches, bugs, etc via email or at dev.kylemaxwell.com


Kyle M.
Chief Technologist
E Factor Media // FN Interactive
removed_email_address@domain.invalid
1-866-263-3261


#2

I just wanted to note that the form_remote_upload works for Rails 1.0,
with the RJS plugin.

To get it working with Edge Rails, please replace JavascriptHelper
with PrototypeHelper on lib/frt_upload_helper.rb#3

Kyle M.
Chief Technologist
E Factor Media // FN Interactive
removed_email_address@domain.invalid
1-866-263-3261


#3

The uploading feature works great, just one problem – Everything
defined in my ApplicationHelper suddenly stops working, ie:

undefined method `thumbnail_default’ for #<#Class:0x220c210:0x220c1ac>

(thumbnail_default is defiend in ApplicationHelper)

I figured something must be wrong with frt_upload_filter.rb so I
commented it all out, restarted the server, and my helpers started to
work again. Any ideas on this one?


#4

Iam having the same exact problem. I tried including the after_filter
directly into the Base controller, but my helpers are still not visible.
Anybody else get their helpers working after installing this plugin,
please
chime in. Appreciate your help.


#5

On 2/14/06, adam roth removed_email_address@domain.invalid wrote:


Posted via http://www.ruby-forum.com/.


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

Try to break down which lines are causing the problem. It’s probably
one of the includes in ActionController::Base around
frt_upload_filter#20.


Kyle M.
Chief Technologist
E Factor Media // FN Interactive
removed_email_address@domain.invalid
1-866-263-3261


#6

As far as I remember, I justI included the after filter directly in the
application controler and then the the helpers were available again. The
other issue I had, is that the upload remote-form-tag has not all the
options and calllbacks of the normal remote-form-tag


#7

I added all the helpers to application.rb, as:

helper :application, :products, :line_items

Then it works fine.

–TJ

adam roth wrote:

The uploading feature works great, just one problem – Everything
defined in my ApplicationHelper suddenly stops working, ie:

undefined method `thumbnail_default’ for #<#Class:0x220c210:0x220c1ac>

(thumbnail_default is defiend in ApplicationHelper)

I figured something must be wrong with frt_upload_filter.rb so I
commented it all out, restarted the server, and my helpers started to
work again. Any ideas on this one?


#8

upload remote-form-tag has not all the
options and calllbacks of the normal remote-form-tag

I implemented the bare minimum of the :loading => “” parameter, plus
RJS template responses. You should be able to get any behavior you
want out of this combination, although perhaps not in the way you are
used to doing.

-Kyle