Forum: Ruby on Rails newbie help

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ac5339e4f1517c3647652e64577964f3?d=identicon&s=25 Stefano Bonomi (trantor)
on 2008-10-12 17:02
Hi,

I have a view, where I need to display some text and then after 5
seconds, redirect to an action automatically (sending one parameter
too).


Googling I've found only solutions for PHP and others, nothing for Ruby
on Rails.

How can I do in ROR ?

Many thanks in advance
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2008-10-12 18:51
(Received via mailing list)
On Sun, Oct 12, 2008 at 8:02 AM, Stefano Bonomi
<rails-mailing-list@andreas-s.net> wrote:

> I have a view, where I need to display some text and then after 5
> seconds, redirect to an action automatically (sending one parameter
> too).

Since this is client-side behavior, it has nothing to do with PHP, RoR
or any other platform. You can do this using either JavaScript or a
META tag.

For the latter, put something like this in the head of your layout:

  <%= @refresh %>

:: and something like this in your controller:

@refresh = '<meta http-equiv="refresh" content="5;url=/foo/param"/>'

:: with the appropriate values.

HTH!
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
Ac5339e4f1517c3647652e64577964f3?d=identicon&s=25 Stefano Bonomi (trantor)
on 2008-10-12 19:02
Hassan Schroeder wrote:
> On Sun, Oct 12, 2008 at 8:02 AM, Stefano Bonomi
> <rails-mailing-list@andreas-s.net> wrote:

> Since this is client-side behavior, it has nothing to do with PHP, RoR
> or any other platform. You can do this using either JavaScript or a
> META tag.
>
> For the latter, put something like this in the head of your layout:
>
>   <%= @refresh %>
>
> :: and something like this in your controller:
>
> @refresh = '<meta http-equiv="refresh" content="5;url=/foo/param"/>'
>
> :: with the appropriate values.
>
> HTH!
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

Thanks a lot Hassan! It works perfectly!
Cb6dc5d568328982a1c09b83656b70e1?d=identicon&s=25 Ing. Mario Navarra (Guest)
on 2008-10-12 19:32
(Received via mailing list)
Hi!
(Ciao),
I do something like what you want with ajax components.
I've used an observer...
now i've not the code, but if you write to me I can send it

bye,
Mario

On 12 Ott, 17:02, Stefano Bonomi <rails-mailing-l...@andreas-s.net>
This topic is locked and can not be replied to.