# Form\_for + catch the complete action

**URL:** <https://www.ruby-forum.com/t/form-for-catch-the-complete-action/159550>\
**Category:** Rails\
**Created:** [February 5, 2009, 5:17pm UTC](https://www.ruby-forum.com/t/form-for-catch-the-complete-action/159550 "2009-02-05T17:17:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![petan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c57346/32.png) [@petan](https://www.ruby-forum.com/u/petan)\
**Post date:** [February 5, 2009, 5:17pm UTC](https://www.ruby-forum.com/t/form-for-catch-the-complete-action/159550/1 "2009-02-05T17:17:49Z")

</div>

Hi I am using classic form\_for to upload pictures using ajax.

\<% form\_for(:images, :url =\> formatted\_images\_path(:format =\> ‘js’),  
:html =\> { :multipart =\> true, :target =\> ‘upload\_frame’ }) do |f| %\>

Is there a way to catch the complete action? I would like to use  
lightbox to show and crop the image in iframe.

thank you.  
Petr

---

<div class="post-metadata">

**Author:** ![petan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c57346/32.png) [@petan](https://www.ruby-forum.com/u/petan)\
**Post date:** [February 5, 2009, 5:32pm UTC](https://www.ruby-forum.com/t/form-for-catch-the-complete-action/159550/2 "2009-02-05T17:32:41Z")

</div>

Can you use form\_remote\_for?

On Feb 5, 11:17 am, Petan C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![petan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c57346/32.png) [@petan](https://www.ruby-forum.com/u/petan)\
**Post date:** [February 5, 2009, 5:41pm UTC](https://www.ruby-forum.com/t/form-for-catch-the-complete-action/159550/3 "2009-02-05T17:41:09Z")

</div>

Hi,

that is the trouble, the upload is not working with remote\_form\_for.

Cheers,  
Petr

Daly wrote:

> Can you use form\_remote\_for?
> 
> On Feb 5, 11:17ï¿½am, Petan C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![petan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c57346/32.png) [@petan](https://www.ruby-forum.com/u/petan)\
**Post date:** [February 5, 2009, 6:11pm UTC](https://www.ruby-forum.com/t/form-for-catch-the-complete-action/159550/4 "2009-02-05T18:11:32Z")

</div>

I used this about a year ago and it worked fine  
[http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-using-attachment\_fu-and-responds\_to\_parent](http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent).  
Not sure if it still works with current versions of Rails.

In my latest app, I used swfupload to provide multiple file uploads  
with a progress bar. There are better alternatives if you are using  
apache and passenger.

On Feb 5, 11:41 am, Petan C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![petan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c57346/32.png) [@petan](https://www.ruby-forum.com/u/petan)\
**Post date:** [February 5, 2009, 6:38pm UTC](https://www.ruby-forum.com/t/form-for-catch-the-complete-action/159550/5 "2009-02-05T18:38:02Z")

</div>

I already used responds\_to\_parent successfully.

What are the better alternatives if we use Apache and Passenger?

---

<div class="post-metadata">

**Author:** ![petan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c57346/32.png) [@petan](https://www.ruby-forum.com/u/petan)\
**Post date:** [February 6, 2009, 9:36pm UTC](https://www.ruby-forum.com/t/form-for-catch-the-complete-action/159550/6 "2009-02-06T21:36:21Z")

</div>

Sorry about the delay:

I found a nice tutorial here:  
[http://www.railsillustrated.com/screencast-file-uploads-progress-in-rails-passenger.html](http://www.railsillustrated.com/screencast-file-uploads-progress-in-rails-passenger.html)

On Feb 5, 12:37 pm, Mathieu R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
