# How to refresh the entire page from link\_to\_remote (RJS)?

**URL:** <https://www.ruby-forum.com/t/how-to-refresh-the-entire-page-from-link-to-remote-rjs/110413>\
**Category:** Rails\
**Created:** [July 26, 2007, 3:59am UTC](https://www.ruby-forum.com/t/how-to-refresh-the-entire-page-from-link-to-remote-rjs/110413 "2007-07-26T03:59:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ADADAD](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/85e7bf/32.png) [@ADADAD](https://www.ruby-forum.com/u/ADADAD)\
**Post date:** [July 26, 2007, 3:59am UTC](https://www.ruby-forum.com/t/how-to-refresh-the-entire-page-from-link-to-remote-rjs/110413/1 "2007-07-26T03:59:43Z")

</div>

I have some RJS functionality for user login. If successful I want to  
refresh the entire page to reflect the new situation, but if I use  
redirect\_to only the target (small) div get replaced with the entire  
page, not entire page.

Any idea?

Thanks,  
AD

---

<div class="post-metadata">

**Author:** ![ADADAD](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/85e7bf/32.png) [@ADADAD](https://www.ruby-forum.com/u/ADADAD)\
**Post date:** [July 26, 2007, 4:05am UTC](https://www.ruby-forum.com/t/how-to-refresh-the-entire-page-from-link-to-remote-rjs/110413/2 "2007-07-26T04:05:43Z")

</div>

On 7/26/07, AD [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks,  
> AD

That’s because you acutally need the client to request the change of  
location. This is done with javascript by using the  
document.locationproperty.

Rails has a helper for it though. You use it in your RJS template like

page.redirect\_to some\_url

Docs at  
[http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper/JavaScriptGenerator/GeneratorMethods.html](http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper/JavaScriptGenerator/GeneratorMethods.html)

HTH  
Daniel

---

<div class="post-metadata">

**Author:** ![ADADAD](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/85e7bf/32.png) [@ADADAD](https://www.ruby-forum.com/u/ADADAD)\
**Post date:** [July 26, 2007, 5:35am UTC](https://www.ruby-forum.com/t/how-to-refresh-the-entire-page-from-link-to-remote-rjs/110413/3 "2007-07-26T05:35:47Z")

</div>

Works great, thanks again.
