# Problem trying to restore last visited page

**URL:** <https://www.ruby-forum.com/t/problem-trying-to-restore-last-visited-page/165922>\
**Category:** Rails\
**Created:** [April 19, 2009, 11:08pm UTC](https://www.ruby-forum.com/t/problem-trying-to-restore-last-visited-page/165922 "2009-04-19T23:08:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cojones](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9f8e36/32.png) [@cojones](https://www.ruby-forum.com/u/cojones)\
**Post date:** [April 19, 2009, 11:08pm UTC](https://www.ruby-forum.com/t/problem-trying-to-restore-last-visited-page/165922/1 "2009-04-19T23:08:23Z")

</div>

Hello,

I have a website that works with remote procedure only. There’s a  
welcome action that actually renders the website and whenever you click  
somewhere it only works with “render :update…”. Now I would like to  
automatically restore the session. For example you enter the site and  
it’s rendered by the action ‘welcome’, I click on ‘show users’ and the  
users are being displayed using “render :update”. At the same time the  
currently viewed page is being saved in the session.  
Now when a user returns I want to show ‘show users’ directly when  
entering the website and not the ‘welcome’ page. Unfortunately I cannot  
use “render :update…” in the beginning already cause there’s nothing  
to replace.

The problem is that all actions but ‘welcome’ can only be accessed using  
xhr so I can’t redirect\_to or something like that.

I hope I could somehow make clear what my problem is and would be really  
appreciate any help 🙂

---

<div class="post-metadata">

**Author:** ![cojones](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9f8e36/32.png) [@cojones](https://www.ruby-forum.com/u/cojones)\
**Post date:** [April 21, 2009, 11:27am UTC](https://www.ruby-forum.com/t/problem-trying-to-restore-last-visited-page/165922/2 "2009-04-21T11:27:14Z")

</div>

Was it described too complicated?

---

<div class="post-metadata">

**Author:** ![cojones](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9f8e36/32.png) [@cojones](https://www.ruby-forum.com/u/cojones)\
**Post date:** [April 21, 2009, 9:14pm UTC](https://www.ruby-forum.com/t/problem-trying-to-restore-last-visited-page/165922/3 "2009-04-21T21:14:34Z")

</div>

Is it maybe possible to automatically reload the website with the proper  
content once it’s loaded and it detected a session?

I couldn’t find any way how to display the website with render :update  
only (page.html or something).

---

<div class="post-metadata">

**Author:** ![cojones](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9f8e36/32.png) [@cojones](https://www.ruby-forum.com/u/cojones)\
**Post date:** [April 23, 2009, 2:09pm UTC](https://www.ruby-forum.com/t/problem-trying-to-restore-last-visited-page/165922/4 "2009-04-23T14:09:21Z")

</div>

Am I that bad in describing my problem or is it just cause nobody  
knows?!

---

<div class="post-metadata">

**Author:** ![cojones](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9f8e36/32.png) [@cojones](https://www.ruby-forum.com/u/cojones)\
**Post date:** [April 22, 2009, 11:38am UTC](https://www.ruby-forum.com/t/problem-trying-to-restore-last-visited-page/165922/5 "2009-04-22T11:38:29Z")

</div>

Would it be possible to do a AJAX call onLoad for body? Can’t really  
find anything for that but I think I read something about it  
somewhere…
