# Acts\_as\_attachment plugin + rails

**URL:** <https://www.ruby-forum.com/t/acts-as-attachment-plugin-rails/70656>\
**Category:** Rails\
**Created:** [October 1, 2006, 4:25pm UTC](https://www.ruby-forum.com/t/acts-as-attachment-plugin-rails/70656 "2006-10-01T16:25:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![so0ly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@so0ly](https://www.ruby-forum.com/u/so0ly)\
**Post date:** [October 1, 2006, 4:25pm UTC](https://www.ruby-forum.com/t/acts-as-attachment-plugin-rails/70656/1 "2006-10-01T16:25:25Z")

</div>

Hello,

Is it possible to use the acts\_as\_attachment plugin with a remote\_form ?  
because when i try to use it i don’t get the file parameter. When i use  
it without ajax it works perfectly.

thnx in advance  
Daan P.

---

<div class="post-metadata">

**Author:** ![so0ly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@so0ly](https://www.ruby-forum.com/u/so0ly)\
**Post date:** [October 1, 2006, 5:14pm UTC](https://www.ruby-forum.com/t/acts-as-attachment-plugin-rails/70656/2 "2006-10-01T17:14:52Z")

</div>

On 10/1/06, Daan P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello,
> 
> Is it possible to use the acts\_as\_attachment plugin with a remote\_form ?  
> because when i try to use it i don’t get the file parameter. When i use  
> it without ajax it works perfectly.
> 
> thnx in advance  
> Daan P.

Javascript doesn’t have access to your files, so it’s not really  
anything with the plugin. You can, however, upload to a hidden  
iframe. It’s very hackish, though.

–  
Rick O.  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)

---

<div class="post-metadata">

**Author:** ![so0ly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@so0ly](https://www.ruby-forum.com/u/so0ly)\
**Post date:** [October 1, 2006, 8:45pm UTC](https://www.ruby-forum.com/t/acts-as-attachment-plugin-rails/70656/3 "2006-10-01T20:45:19Z")

</div>

Rick O. wrote:

> On 10/1/06, Daan P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Hello,
> > 
> > Is it possible to use the acts\_as\_attachment plugin with a remote\_form ?  
> > because when i try to use it i don’t get the file parameter. When i use  
> > it without ajax it works perfectly.
> > 
> > thnx in advance  
> > Daan P.
> 
> Javascript doesn’t have access to your files, so it’s not really  
> anything with the plugin. You can, however, upload to a hidden  
> iframe. It’s very hackish, though.
> 
> –  
> Rick O.  
> [http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
> [http://mephistoblog.com](http://mephistoblog.com)

is it possible to link to an rjs file with a regular form ? or can i do  
some ajax commands in the iframe ?

gr  
Daan P.

---

<div class="post-metadata">

**Author:** ![so0ly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@so0ly](https://www.ruby-forum.com/u/so0ly)\
**Post date:** [October 2, 2006, 12:57am UTC](https://www.ruby-forum.com/t/acts-as-attachment-plugin-rails/70656/4 "2006-10-02T00:57:47Z")

</div>

On Oct 1, 2006, at 11:45 AM, Daan P. wrote:

> > > it without ajax it works perfectly.  
> > > Rick O.  
> > > [http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
> > > [http://mephistoblog.com](http://mephistoblog.com)
> 
> is it possible to link to an rjs file with a regular form ? or can  
> i do  
> some ajax commands in the iframe ?
> 
> gr  
> Daan P.

Hey Daan-

```
There is a plugin called respond_to_parent that will allow you to

```

return rjs to the iframe and have it eval’ed in the parent window.

[http://sean.treadway.info/svn/plugins/responds\_to\_parent/README](http://sean.treadway.info/svn/plugins/responds_to_parent/README)

-Ezra

---

<div class="post-metadata">

**Author:** ![so0ly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@so0ly](https://www.ruby-forum.com/u/so0ly)\
**Post date:** [October 28, 2006, 5:14am UTC](https://www.ruby-forum.com/t/acts-as-attachment-plugin-rails/70656/5 "2006-10-28T05:14:58Z")

</div>

does anybody know how to install the dang thing?

[http://weblog.techno-weenie.net/articles/acts\_as\_attachment](http://weblog.techno-weenie.net/articles/acts_as_attachment)

I got as far as this:

rake test\_plugins PLUGIN=acts\_as\_attachement  
(in /x/home/foobar/docs/thefoobar.com/thefoobar)  
/usr/bin/ruby18 -Ilib:test  
“/usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake\_test\_loader.rb”

real helpful instructions there buddy 😛

I manually create the tables, but still no luck.  
[http://weblog.techno-weenie.net/articles/acts\_as\_attachment](http://weblog.techno-weenie.net/articles/acts_as_attachment)

---

<div class="post-metadata">

**Author:** ![so0ly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@so0ly](https://www.ruby-forum.com/u/so0ly)\
**Post date:** [October 2, 2006, 3:01pm UTC](https://www.ruby-forum.com/t/acts-as-attachment-plugin-rails/70656/6 "2006-10-02T15:01:53Z")

</div>

Ezra Z. wrote:

> On Oct 1, 2006, at 11:45 AM, Daan P. wrote:
> 
> > > > it without ajax it works perfectly.  
> > > > Rick O.  
> > > > [http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
> > > > [http://mephistoblog.com](http://mephistoblog.com)
> > 
> > is it possible to link to an rjs file with a regular form ? or can  
> > i do  
> > some ajax commands in the iframe ?
> > 
> > gr  
> > Daan P.
> 
> Hey Daan-
> 
> There is a plugin called respond\_to\_parent that will allow you to  
> return rjs to the iframe and have it eval’ed in the parent window.
> 
> [http://sean.treadway.info/svn/plugins/responds\_to\_parent/README](http://sean.treadway.info/svn/plugins/responds_to_parent/README)
> 
> -Ezra

thnx 😛 it works great 🙂  
but now i’m having another problem with act as attachment … when i  
generate my thumbnails they aren’t saved on my filesystm only in my db

grts  
Daan P.

---

<div class="post-metadata">

**Author:** ![so0ly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@so0ly](https://www.ruby-forum.com/u/so0ly)\
**Post date:** [October 29, 2006, 2:42am UTC](https://www.ruby-forum.com/t/acts-as-attachment-plugin-rails/70656/7 "2006-10-29T02:42:08Z")

</div>

> rake test\_plugins PLUGIN=acts\_as\_attachement  
> (in /x/home/foobar/docs/thefoobar.com/thefoobar)  
> /usr/bin/ruby18 -Ilib:test  
> “/usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake\_test\_loader.rb”

real helpful stack trace there buddy.

–  
Rick O.  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)
