# \[ANN\] form\_remote\_upload plugin

**URL:** <https://www.ruby-forum.com/t/ann-form-remote-upload-plugin/66030>\
**Category:** Rails\
**Created:** [February 12, 2006, 2:25am UTC](https://www.ruby-forum.com/t/ann-form-remote-upload-plugin/66030 "2006-02-12T02:25:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [February 12, 2006, 2:25am UTC](https://www.ruby-forum.com/t/ann-form-remote-upload-plugin/66030/1 "2006-02-12T02:25:10Z")

</div>

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](http://svn.kylemaxwell.com/form_remote_upload/trunk)

Patches, bugs, etc via email or at [dev.kylemaxwell.com](http://dev.kylemaxwell.com)

–  
Kyle M.  
Chief Technologist  
E Factor Media // FN Interactive  
removed\_email\_address@domain.invalid  
1-866-263-3261

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [February 14, 2006, 7:03pm UTC](https://www.ruby-forum.com/t/ann-form-remote-upload-plugin/66030/2 "2006-02-14T19:03:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [February 15, 2006, 6:45am UTC](https://www.ruby-forum.com/t/ann-form-remote-upload-plugin/66030/3 "2006-02-15T06:45:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [March 22, 2006, 10:50pm UTC](https://www.ruby-forum.com/t/ann-form-remote-upload-plugin/66030/4 "2006-03-22T22:50:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [February 15, 2006, 6:07pm UTC](https://www.ruby-forum.com/t/ann-form-remote-upload-plugin/66030/5 "2006-02-15T18:07:50Z")

</div>

On 2/14/06, adam roth [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](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

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [March 23, 2006, 2:48am UTC](https://www.ruby-forum.com/t/ann-form-remote-upload-plugin/66030/6 "2006-03-23T02:48:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [March 23, 2006, 5:10am UTC](https://www.ruby-forum.com/t/ann-form-remote-upload-plugin/66030/7 "2006-03-23T05:10:52Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kylemathews](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/51bf81/32.png) [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Post date:** [March 23, 2006, 7:42pm UTC](https://www.ruby-forum.com/t/ann-form-remote-upload-plugin/66030/8 "2006-03-23T19:42:30Z")

</div>

> 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
