# Prevent multiple reloads of a page

**URL:** <https://www.ruby-forum.com/t/prevent-multiple-reloads-of-a-page/146825>\
**Category:** Rails\
**Created:** [August 25, 2008, 10:52pm UTC](https://www.ruby-forum.com/t/prevent-multiple-reloads-of-a-page/146825 "2008-08-25T22:52:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jawosis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f04885/32.png) [@jawosis](https://www.ruby-forum.com/u/jawosis)\
**Post date:** [August 25, 2008, 10:52pm UTC](https://www.ruby-forum.com/t/prevent-multiple-reloads-of-a-page/146825/1 "2008-08-25T22:52:58Z")

</div>

The User will get a static page with the info that we just send a  
confirmation email.

something like [http://www.home.de/confirmation\_email\_send](http://www.home.de/confirmation_email_send)

When the user now hits reload I want him to be automatically redirect  
to root\_path.

Whats the recommended way to do this?

Thanx

---

<div class="post-metadata">

**Author:** ![jawosis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f04885/32.png) [@jawosis](https://www.ruby-forum.com/u/jawosis)\
**Post date:** [August 25, 2008, 11:32pm UTC](https://www.ruby-forum.com/t/prevent-multiple-reloads-of-a-page/146825/2 "2008-08-25T23:32:12Z")

</div>

On Mon, Aug 25, 2008 at 10:51 PM, Jochen K.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> The User will get a static page with the info that we just send a  
> confirmation email.
> 
> something like [http://www.home.de/confirmation\_email\_send](http://www.home.de/confirmation_email_send)
> 
> When the user now hits reload I want him to be automatically redirect  
> to root\_path.
> 
> Whats the recommended way to do this?

It seems to be a strange way of doing things, but maybe you can have  
it with something like

```
def confirmation
    if flash[:confirmation_already_sended]
        redirect_to root_path
    else
        flash[:confirmation_already_sended] = true
    end
end

```

In your controller for this action.

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