# Render :js =\> "alert('Test !')"

**URL:** <https://www.ruby-forum.com/t/render-js-alert-test/191922>\
**Category:** Rails\
**Created:** [July 20, 2010, 7:45pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922 "2010-07-20T19:45:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 20, 2010, 7:45pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/1 "2010-07-20T19:45:20Z")

</div>

Hi Folks,

I use render :js =\> “alert(‘Test !’)” in my modele, but instead of  
having the alert displayed, the browser try to donload a file containing  
this string : \<\<render :js =\> “alert(‘Test !’)”\>\>. Do you know why I the  
browser behaves such a way ?

Regards

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 20, 2010, 7:47pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/2 "2010-07-20T19:47:00Z")

</div>

Sorry, in the text before I made a mistake, please read ‘‘in my  
controller’’ instead of ‘‘my model’’

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 20, 2010, 7:47pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/3 "2010-07-20T19:47:55Z")

</div>

Mamadou TourÃ© wrote:

> Hi Folks,
> 
> I use render :js =\> “alert(‘Test !’)” in my modele,

In your _model_? render doesn’t go there.

> but instead of  
> having the alert displayed, the browser try to donload a file containing  
> this string : \<\<render :js =\> “alert(‘Test !’)”\>\>. Do you know why I the  
> browser behaves such a way ?

We’d need to know a bit more about the structure of your application and  
where this code is to understand. Normally, render statements go in the  
controller or the view…

> Regards

## Best,

Marnen Laibow-Koser

> **[marnen.org: Homepage of Marnen Laibow-Koser](https://marnen.org/)**

[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 20, 2010, 8:16pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/4 "2010-07-20T20:16:40Z")

</div>

Marnen Laibow-Koser wrote:

> Marnen Laibow-Koser wrote:
> 
> > Mamadou TourÃ© wrote:
> > 
> > > Hi Folks,
> > > 
> > > I use render :js =\> “alert(‘Test !’)” in my modele,
> > 
> > In your _model_? render doesn’t go there.
> 
> OK, just saw your correction.
> 
> > > but instead of  
> > > having the alert displayed, the browser try to donload a file containing  
> > > this string : \<\<render :js =\> “alert(‘Test !’)”\>\>. Do you know why I the  
> > > browser behaves such a way ?
> > 
> > We’d need to know a bit more about the structure of your application and  
> > where this code is to understand. Normally, render statements go in the  
> > controller or the view…
> 
> Let’s see your controller code.
> 
> > > Regards
> > 
> > ## Best,
> > 
> > Marnen Laibow-Koser  
> > [http://www.marnen.org](http://www.marnen.org)  
> > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Hi Marnen, here is my controller code (the method ‘generer’ is triggered  
once a user hit a submit button)

def generer  
vue = getvue(params[:id])  
arr\_doc = Array.new()  
arr\_doc = params[:arr].split(“,”)  
params[:arr].gsub!(/[,]/, ‘^’)  
vaat\_val\_lang = vue.langue

```
if vaat_val_lang.eql?("F")
   vaat_id_lang = 5
else
   vaat_id_lang = 6
end

plsql = nil
plsql = connection.parse('begin 

```

corr\_pck\_formul\_intellgnt.prc\_fi\_sous(:p\_dect\_id  
,:p\_vaat\_id\_langue\_docu  
,:p\_list\_doc  
,  
:p\_drive); end;')

```
plsql.bind_param(':p_dect_id', vue.dect_id, Integer)
plsql.bind_param(':p_vaat_id_langue_docu', vaat_id_lang, Integer)
plsql.bind_param(':p_list_doc', params[:arr], String)
plsql.bind_param(':p_drive',path_drive, String)
plsql.exec
render :js => "alert('Test !');"

```

end

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 20, 2010, 8:44pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/5 "2010-07-20T20:44:30Z")

</div>

Mamadou TourÃ© wrote:  
[…]

> Hi Marnen, here is my controller code (the method ‘generer’ is triggered  
> once a user hit a submit button)

I don’t see offhand why your render statement isn’t working well, but  
you’ve got _a lot_ of other problems in your code.

First of all, the entire method may be too long. You may want to split  
it up.

> def generer  
> vue = getvue(params[:id])

Why not an ActiveRecord query? And why getvue instead of get\_vue ?

> ```
> arr_doc = Array.new()
> 
> ```

That line is unnecessary, since the split in the next line already  
creates the array.

> ```
> arr_doc = params[:arr].split(",")
> params[:arr].gsub!(/[,]/, '^')
> 
> ```

The brackets in the regex are unnecessary. Actually, the regex itself  
can just be a string. Anyway, the whole line is probably unnecessary,  
since it doesn’t look like params[:arr] gets referred to after this.

> ```
> vaat_val_lang = vue.langue
> 
> if vaat_val_lang.eql?("F")
> 
> ```

Why eql? ? It’s perfectly fine to use == with strings.

> ```
> vaat_id_lang = 5
> else
> vaat_id_lang = 6
> end
> 
> ```

You could probably replace this with an AR query.

> ```
> plsql = nil
> plsql = connection.parse('begin 
> 
> ```
> 
> corr\_pck\_formul\_intellgnt.prc\_fi\_sous(:p\_dect\_id  
> ,:p\_vaat\_id\_langue\_docu  
> ,:p\_list\_doc  
> ,  
> :p\_drive); end;')
> 
> ```
> plsql.bind_param(':p_dect_id', vue.dect_id, Integer)
> plsql.bind_param(':p_vaat_id_langue_docu', vaat_id_lang, Integer)
> plsql.bind_param(':p_list_doc', params[:arr], String)
> plsql.bind_param(':p_drive',path_drive, String)
> plsql.exec
> 
> ```

Why not just find\_by\_sql or connection.execute ?

> ```
> render :js => "alert('Test !');"
> 
> ```

This should work. In fact, it sounds like it _is_ working – it’s  
sending the text to the browser just like it should. What it may not be  
doing properly is setting the MIME type. Can you check the MIME type of  
the response?

> end

## Best,

Marnen Laibow-Koser

> **[marnen.org: Homepage of Marnen Laibow-Koser](https://marnen.org/)**

[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 20, 2010, 7:48pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/6 "2010-07-20T19:48:50Z")

</div>

Marnen Laibow-Koser wrote:

> Mamadou TourÃ© wrote:
> 
> > Hi Folks,
> > 
> > I use render :js =\> “alert(‘Test !’)” in my modele,
> 
> In your _model_? render doesn’t go there.

OK, just saw your correction.

> > but instead of  
> > having the alert displayed, the browser try to donload a file containing  
> > this string : \<\<render :js =\> “alert(‘Test !’)”\>\>. Do you know why I the  
> > browser behaves such a way ?
> 
> We’d need to know a bit more about the structure of your application and  
> where this code is to understand. Normally, render statements go in the  
> controller or the view…

Let’s see your controller code.

> > Regards
> 
> ## Best,
> 
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 20, 2010, 9:46pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/7 "2010-07-20T21:46:35Z")

</div>

> This should work. In fact, it sounds like it _is_ working – it’s  
> sending the text to the browser just like it should. What it may not be  
> doing properly is setting the MIME type. Can you check the MIME type of  
> the response?
> 
> > end
> 
> ## Best,
> 
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Thanks a lot for the code review. I’m new in Ruby (coming from an AS/400  
background), that’s why I just ‘‘copy-paste’’ code from other ruby  
application.

The Mime-type is text/javascript, and I think this one is obsolete , and  
I want to set my response Mime-type to ‘application/javascript’', how  
to do that ? should I add it to render :js =\> “alert(‘Test !’);” ?

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 20, 2010, 10:17pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/8 "2010-07-20T22:17:43Z")

</div>

Mamadou TourÃ© wrote:

> > This should work. In fact, it sounds like it _is_ working – it’s  
> > sending the text to the browser just like it should. What it may not be  
> > doing properly is setting the MIME type. Can you check the MIME type of  
> > the response?
> > 
> > > end
> > 
> > ## Best,
> > 
> > Marnen Laibow-Koser  
> > [http://www.marnen.org](http://www.marnen.org)  
> > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> Thanks a lot for the code review. I’m new in Ruby (coming from an AS/400  
> background)

AS/400 isn’t a language…

(FWIW, my first professional programming job was working in RPG on an  
AS/400. I’m better now, thanks. 🙂 )

> , that’s why I just ‘‘copy-paste’’ code from other ruby  
> application.

Ooooh. That’s really bad. You need to learn the basics of the language  
a bit better, I think.

> The Mime-type is text/javascript, and I think this one is obsolete , and  
> I want to set my response Mime-type to ‘application/javascript’', how  
> to do that ? should I add it to render :js =\> “alert(‘Test !’);” ?

You don’t want to do that. Check out  
[JavaScript: some MIME types](http://krijnhoetmer.nl/stuff/javascript/mime-types/) :  
application/javascript is only recognized by a few browsers.  
text/javascript is the best understood type.

## Best,

Marnen Laibow-Koser

> **[marnen.org: Homepage of Marnen Laibow-Koser](https://marnen.org/)**

[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 20, 2010, 10:29pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/9 "2010-07-20T22:29:03Z")

</div>

On 20 July 2010 21:17, Marnen Laibow-Koser [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ..  
> (FWIW, my first professional programming job was working in RPG on an  
> AS/400. I’m better now, thanks. 🙂 )

Wow, so was mine (RPG that is, in my case on an IBM360 I think). It  
was about 1968. Though looking on Wikipedia I see that it is not much  
like Report Program Generator any more. And I am not at all nostalgic  
about it, it was absolute rubbish.

Colin

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 21, 2010, 1:10am UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/10 "2010-07-21T01:10:30Z")

</div>

> AS/400 isn’t a language…
> 
> (FWIW, my first professional programming job was working in RPG on an  
> AS/400. I’m better now, thanks. 🙂 )

> –  
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Yeah of course I know AS/400 is not a language (the language I used on  
AS/400 were RPG/400 and the CLP), AS/400 is just a system like the  
IBM36, IBM38, IBM34 etc… My first job also was on AS/400 environnement  
in 1994 ;))

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 21, 2010, 10:26am UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/11 "2010-07-21T10:26:44Z")

</div>

render :js is something that can be used in place of the render :update.  
Which means, the request type should be XHR and not HTTP… in simple  
words, the render :js will only work for Ajax requests.

If you want something of this sort for the normal HTTP requests… it  
can be achieved by something like this in your controller…

@js = “alert(‘hi’)” # or whatever set of js statements needed  
render :inline =\> “\<%= javascript\_tag(@js) %\>”

regards,  
Sur

[http://crimson9.com](http://crimson9.com)

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 21, 2010, 1:18am UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/12 "2010-07-21T01:18:40Z")

</div>

> > , that’s why I just ‘‘copy-paste’’ code from other ruby  
> > application.
> 
> Ooooh. That’s really bad. You need to learn the basics of the language  
> a bit better, I think.  
> Yeah I started 4 months ago to learn Ruby (using books such Ruby on  
> Rails bible, Railspace). Right now I`m involved in some projects with deadlines, that's why sometimes I copy-paste, but you`re right I will  
> avoid that

> > The Mime-type is text/javascript, and I think this one is obsolete , and  
> > I want to set my response Mime-type to ‘application/javascript’', how  
> > to do that ? should I add it to render :js =\> “alert(‘Test !’);” ?

> ## You don’t want to do that. Check out [JavaScript: some MIME types](http://krijnhoetmer.nl/stuff/javascript/mime-types/) : application/javascript is only recognized by a few browsers. text/javascript is the best understood type. So In my response the mime-type is ‘text/javascript’, but the isssue is still here…, so what’s wrong then ? Best,
> 
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 21, 2010, 2:23pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/13 "2010-07-21T14:23:21Z")

</div>

Sur M. wrote:

> render :js is something that can be used in place of the render :update.  
> Which means, the request type should be XHR and not HTTP… in simple  
> words, the render :js will only work for Ajax requests.
> 
> If you want something of this sort for the normal HTTP requests… it  
> can be achieved by something like this in your controller…
> 
> @js = “alert(‘hi’)” # or whatever set of js statements needed  
> render :inline =\> “\<%= javascript\_tag(@js) %\>”
> 
> regards,  
> Sur
> 
> [http://crimson9.com](http://crimson9.com)

Hi Sur,

I did what you suggested, yes it displays the alert, but behind it my  
originala screen has disappeared. What I want is to display the alert  
without having the screen where the user pressed the submit button  
disapears.

regards

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 21, 2010, 5:12pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/14 "2010-07-21T17:12:35Z")

</div>

You need to use Ajax there.

Instead of form\_for you will need to use form\_remote\_for.

regards,  
Sur

[http://crimson9.com](http://crimson9.com)

Mamadou TourÃ© wrote:

> Sur M. wrote:
> 
> > render :js is something that can be used in place of the render :update.  
> > Which means, the request type should be XHR and not HTTP… in simple  
> > words, the render :js will only work for Ajax requests.
> > 
> > If you want something of this sort for the normal HTTP requests… it  
> > can be achieved by something like this in your controller…
> > 
> > @js = “alert(‘hi’)” # or whatever set of js statements needed  
> > render :inline =\> “\<%= javascript\_tag(@js) %\>”
> > 
> > regards,  
> > Sur
> > 
> > [http://crimson9.com](http://crimson9.com)
> 
> Hi Sur,
> 
> I did what you suggested, yes it displays the alert, but behind it my  
> originala screen has disappeared. What I want is to display the alert  
> without having the screen where the user pressed the submit button  
> disapears.
> 
> regards

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 21, 2010, 7:23pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/15 "2010-07-21T19:23:17Z")

</div>

🙂

I would suggest you to read about the Ajax/RJS in general and in Rails.  
There are numerous free books/resources available.

For the stuff you just asked, it’s like this…

It’s called indicator, for which most of the world use an animated gif  
image for the purpose.  
So you need to put an indicator image in a hidden state. And then you  
can show/hide it based on the ajax request status.  
Here you can pick up any gif image you would like

> **[Activity indicators | Animated GIFs for when your is working](https://mentalized.net/activity-indicators/)**
>
> A collection of royalty-free animated GIF icons you can use to show when your web application is loading and working

there are numerous more available on web.

And can implement it as following…

Say, your image is indicator.gif  
put your gif image anywhere in your form or on your page like this…

\<%= image\_tag “indicator.gif”, :id =\> “any\_uniq\_indicator\_id”, :style =\>  
“display:none” %\>

And add this to your form\_remote\_tag code… (ps: the loading and  
complete parameters)

\<%= form\_remote\_for :some\_symbol, :url =\> the\_url\_youve\_given, :loading  
=\> “$(‘any\_uniq\_indicator\_id’).show()”, :complete =\>  
“$(‘any\_uniq\_indicator\_id’).show()” %\>

regards,  
Sur

[http://crimson9.com](http://crimson9.com)

Mamadou TourÃ© wrote:

> Sur M. wrote:
> 
> > You need to use Ajax there.
> > 
> > Instead of form\_for you will need to use form\_remote\_for.
> > 
> > regards,  
> > Sur
> > 
> > [http://crimson9.com](http://crimson9.com)
> 
> Thanks Sur, it works, but I need one more thing. When I hit the submit  
> button, this will trigger process that creates the xdp files, but with  
> this change now, the page is too “silent” during the process (the mouse  
> cursor does not move, everything is quite), so the user would thing that  
> nothing is happening. Is there a way to have the cursor mouse like busy  
> during the process ?

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 21, 2010, 7:42pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/16 "2010-07-21T19:42:22Z")

</div>

Correct it…

\<%= form\_remote\_for :some\_symbol, :url =\> the\_url\_youve\_given, :loading  
=\> “$(‘any\_uniq\_indicator\_id’).show()”, :complete =\>  
“$(‘any\_uniq\_indicator\_id’).hide()” %\>

In complete, it should be hide()

regards,  
Sur  
[http://crimson9.com](http://crimson9.com)

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 21, 2010, 7:44pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/17 "2010-07-21T19:44:07Z")

</div>

2010/7/21 Mamadou Touré [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Thanks Sur, it works, but I need one more thing. When I hit the submit  
> button, this will trigger process that creates the xdp files, but with  
> this change now, the page is too “silent” during the process (the mouse  
> cursor does not move, everything is quite), so the user would thing that  
> nothing is happening. Is there a way to have the cursor mouse like busy  
> during the process ?

> **[User interface](https://www.w3.org/TR/CSS2/ui.html)**

–  
Hassan S. ------------------------ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
twitter: @hassan

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 21, 2010, 9:17pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/18 "2010-07-21T21:17:24Z")

</div>

Sur M. wrote:

> Correct it…
> 
> \<%= form\_remote\_for :some\_symbol, :url =\> the\_url\_youve\_given, :loading  
> =\> “$(‘any\_uniq\_indicator\_id’).show()”, :complete =\>  
> “$(‘any\_uniq\_indicator\_id’).hide()” %\>
> 
> In complete, it should be hide()
> 
> regards,  
> Sur  
> [http://crimson9.com](http://crimson9.com)

Thanks a lot Sur, it works perfect ! “Ã‡a marche comme sur des  
roulettes” as we say in french. yeah for the little mistake, I guessed  
it would be .hide() ;-))

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 21, 2010, 10:42pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/19 "2010-07-21T22:42:00Z")

</div>

You are welcome  
I am glad it helped you 🙂

Vous Ãªtes les bienvenus  
Je suis content que vous avez aidÃ© 🙂

regards,  
Sur  
[http://crimson9.com](http://crimson9.com)

---

<div class="post-metadata">

**Author:** ![mamadoutoure](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecb155/32.png) [@mamadoutoure](https://www.ruby-forum.com/u/mamadoutoure)\
**Post date:** [July 21, 2010, 7:11pm UTC](https://www.ruby-forum.com/t/render-js-alert-test/191922/20 "2010-07-21T19:11:44Z")

</div>

Sur M. wrote:

> You need to use Ajax there.
> 
> Instead of form\_for you will need to use form\_remote\_for.
> 
> regards,  
> Sur
> 
> [http://crimson9.com](http://crimson9.com)

Thanks Sur, it works, but I need one more thing. When I hit the submit  
button, this will trigger process that creates the xdp files, but with  
this change now, the page is too “silent” during the process (the mouse  
cursor does not move, everything is quite), so the user would thing that  
nothing is happening. Is there a way to have the cursor mouse like busy  
during the process ?

[Next page](https://www.ruby-forum.com/t/render-js-alert-test/191922.md?page=2)
