On 5 Mar 2009, at 21:14, Tom Ha wrote:

>
> Hi there,
>
> I'm sure a lot of you guys have come across this question:
>
> How can we render several :partials on a page *before* the called
> :action has finished?
>
> Basically, my situation is this:
>
> When I click on a certain button, 3 things are supposed to happen:
> - INSTANTLY: the button should become disabled (either by setting
> ":disabled" to "true" by updating the partial or by using
> ":disable_with")
> - INSTANTLY: one or several things should appear on the page (probably
> as :partials)
> - "IN THE BACKGROUND": sending out 2 emails (which takes too much time
> to wait for)
>
> The thing is: it's impossible to do it like below (since "render"  
> always
> seems to be executed at the end of an :action):
>
> render :update do |page|
>  page.replace_html 'whateverDiv', :partial => 'whateverPartial'
>  page.replace_html 'whateverDiv2', :partial => 'whateverPartial2'
> end
>
The response is only send out when fully finished. If you want  
something like this then one option is to push the background task  
into something like backgroundrb or bj (so that the action does finish  
quickly)

Fred
> What's the easiest/best solution in Rails to solve this problem?
>
> Thanks a lot for your help!
> Tom
> -- 
> Posted via http://www.ruby-forum.com/.
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to