Problem trying to restore last visited page


#1

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 :slight_smile:


#2

Was it described too complicated?


#3

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).


#4

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


#5

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…