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.
4bd34a2216dc8bdbf1f017f64e4d59e8?d=identicon&s=25 Kyle Maxwell (Guest)
on 2006-02-12 02: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 Maxwell
Chief Technologist
E Factor Media // FN Interactive
kyle@efactormedia.com
1-866-263-3261
4bd34a2216dc8bdbf1f017f64e4d59e8?d=identicon&s=25 Kyle Maxwell (Guest)
on 2006-02-14 19: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 Maxwell
Chief Technologist
E Factor Media // FN Interactive
kyle@efactormedia.com
1-866-263-3261
7a5ed48939fc288a4c70778140b203f6?d=identicon&s=25 adam roth (Guest)
on 2006-02-15 06: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?
4bd34a2216dc8bdbf1f017f64e4d59e8?d=identicon&s=25 Kyle Maxwell (Guest)
on 2006-02-15 18:07
(Received via mailing list)
On 2/14/06, adam roth <adamjroth@gmail.com> wrote:
>
>
>
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> 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 Maxwell
Chief Technologist
E Factor Media // FN Interactive
kyle@efactormedia.com
1-866-263-3261
7641cc060587bde6599ca811a1a52788?d=identicon&s=25 Sunder Iyer (Guest)
on 2006-03-22 22: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.
30269682335f1fb247d71969fa715b5e?d=identicon&s=25 Roberto Saccon (rsaccon)
on 2006-03-23 02: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
1843ba3c4ff9cc702bc3474223a0acc6?d=identicon&s=25 Tony Jin (tony)
on 2006-03-23 05: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?
4bd34a2216dc8bdbf1f017f64e4d59e8?d=identicon&s=25 Kyle Maxwell (Guest)
on 2006-03-23 19: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.