Forum: Ruby on Rails [ANN] form_remote_upload plugin

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.
Kyle M. (Guest)
on 2006-02-12 03:25
(Received via mailing list)
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
Kyle M. (Guest)
on 2006-02-14 20:03
(Received via mailing list)
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
adam roth (Guest)
on 2006-02-15 07:45
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?
Kyle M. (Guest)
on 2006-02-15 19:07
(Received via mailing list)
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
Sunder I. (Guest)
on 2006-03-22 23:50
(Received via mailing list)
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.
Roberto S. (Guest)
on 2006-03-23 03:48
(Received via mailing list)
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
Tony J. (Guest)
on 2006-03-23 06:10
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?
Kyle M. (Guest)
on 2006-03-23 20:42
(Received via mailing list)
> 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
This topic is locked and can not be replied to.