How to show waiting msg while rails is doing something else

Hi,

I have some calculation to do in some part of my ruby-rails application,
I wish to show a “waiting message” whilw rails is calculating the result
and when the result is already, I can remove the waiting message and put
the final result. I have no idea how I can do this. can some one give me
a clue???

Thanks you very much

Sayoyo

sayoyo wrote:

Hi,

I have some calculation to do in some part of my ruby-rails application,
I wish to show a “waiting message” whilw rails is calculating the result
and when the result is already, I can remove the waiting message and put
the final result. I have no idea how I can do this. can some one give me
a clue???

Thanks you very much

Sayoyo

This action might be a great candidate to use AJAX for… Check out
this simple tutorial on the subject:

It should help you out.

  • Greetz,

Danny

Hi,

Thanks you very much for the info. But, we have already tried, but it
doesn’t really what we need, since we have to tell the users how many
percentage the task has been completed, ajax just allow us the change
the html contain once, but not a interval of time… also, we render to
a new /controller/action when the calculation happens. so ajax can’t
hardly apply here,

Thanks you very much for the information

Saiho

Daniel Owen van Dommelen wrote:

sayoyo wrote:

Hi,

I have some calculation to do in some part of my ruby-rails application,
I wish to show a “waiting message” whilw rails is calculating the result
and when the result is already, I can remove the waiting message and put
the final result. I have no idea how I can do this. can some one give me
a clue???

Thanks you very much

Sayoyo

This action might be a great candidate to use AJAX for… Check out
this simple tutorial on the subject:

Radar – O’Reilly

It should help you out.

  • Greetz,

Danny

sayoyo wrote:

Hi,

Thanks you very much for the info. But, we have already tried, but it
doesn’t really what we need, since we have to tell the users how many
percentage the task has been completed, ajax just allow us the change
the html contain once, but not a interval of time… also, we render to
a new /controller/action when the calculation happens. so ajax can’t
hardly apply here,

Thanks you very much for the information

Saiho

Ajax does have methods for doing your interval thing. Just check the
second page of the tutorial it speaks of it a little… Consider this
little extract from the tutorial:

Live Search:
<%= text_field_tag :searchtext %>
<%= observe_field(:searchtext,
:frequency => 0.25,
:update => :search_hits,
:url => { :action => :live_search }) %>

Search Results:

Just check the Internet a little for some info. Since I’m currently
actually learning Rails (have to know enough to work in it by monday) I
can’t really help you specifically, but Ajax is definately the way to go
here, I believe anyway…

Hi Daniel,

Once again thanks you for the informatin, however, “the interval” you
have mentionned works on a specific html component(oberver field), I’m
really not sure that it will work on a currently running rails processus
(I may be wrong), what we are trying to do is gathering information from
user, than compute the information, to activate the computation, we use
a normal “rails-button” from a form it means, it will send the result on
a new /controller/action. but between the old /controller/action and the
new one, there will pass a several seconds, 10 -20 sec. but since the
“post/get” is already send to server, the browser is waiting… and we
would like to have some “waiting message”, just want to keep the user
eye busy…

Thanks you bery much

Saiho

Daniel Owen van Dommelen wrote:

sayoyo wrote:

Hi,

Thanks you very much for the info. But, we have already tried, but it
doesn’t really what we need, since we have to tell the users how many
percentage the task has been completed, ajax just allow us the change
the html contain once, but not a interval of time… also, we render to
a new /controller/action when the calculation happens. so ajax can’t
hardly apply here,

Thanks you very much for the information

Saiho

Ajax does have methods for doing your interval thing. Just check the
second page of the tutorial it speaks of it a little… Consider this
little extract from the tutorial:

Live Search:
<%= text_field_tag :searchtext %>
<%= observe_field(:searchtext,
:frequency => 0.25,
:update => :search_hits,
:url => { :action => :live_search }) %>

Search Results:

Just check the Internet a little for some info. Since I’m currently
actually learning Rails (have to know enough to work in it by monday) I
can’t really help you specifically, but Ajax is definately the way to go
here, I believe anyway…

OK,

thanks for the information I will have a close look on it!

why don’t you try backgroundrb ?

http://backgroundrb.rubyforge.org/

sayoyo wrote:

Hi Daniel,

Once again thanks you for the informatin, however, “the interval” you
have mentionned works on a specific html component(oberver field), I’m
really not sure that it will work on a currently running rails processus
(I may be wrong), what we are trying to do is gathering information from
user, than compute the information, to activate the computation, we use
a normal “rails-button” from a form it means, it will send the result on
a new /controller/action. but between the old /controller/action and the
new one, there will pass a several seconds, 10 -20 sec. but since the
“post/get” is already send to server, the browser is waiting… and we
would like to have some “waiting message”, just want to keep the user
eye busy…

Thanks you bery much

Saiho

why don’t you try backgroundrb ?

http://backgroundrb.rubyforge.org/

there is a rjs tutorial from oreilly for 6 bucks… i highly recommend it
because it shows how awesome it is to use rjs + ajax.

sayoyo

wrote:

Hi,

I have some calculation to do in some part of my ruby-rails application,
I wish to show a “waiting message” whilw rails is calculating the result
and when the result is already, I can remove the waiting message and put
the final result. I have no idea how I can do this. can some one give me
a clue???

Thanks you very much

Sayoyo

I think what you are after goes under the title “Progress Bar”.

Maybe search the web for that.

Stephan