You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Tab, ajax, history problem Created Nov 14, 2009

This thread is solved

Views: 627     Replies: 1     Last reply Nov 15, 2009  
You must login first before you can use this feature

notromda

Posts: 4

Registered:
Nov 13, 2009

Tab, ajax, history problem

Posted: Nov 14, 2009

I have a page that is making ajax queries to a rails application. The history works fine within the page with the tabs, but if I hit the back button to before the page with tabs, and then hit the forward button, I'm greeted with the text of the ajax request for that page.

One possible complication could be that it has the same url -

http://localhost:3000/people/1

for both the html request and for the ajax xhr request. Is that causing a problem? Update It must be, because when I comment out that tab, all works as expected.

If so, is there a way I can have the first tab filled by the first page view and subsequent tabs by ajax? This is a restful resource that is viewing nested resources on other tabs... and so the proper "restful" route for the first tab happens to be the same as the main HTML url.

notromda

Posts: 4

Registered:
Nov 13, 2009

workaround

Posted: Nov 15, 2009

Reply to: Tab, ajax, history problem, from notromda
As a workaround, I added a parameter to the link, which gives it a "different" url than the main resource. I don't even have to use it in my controller, it just has to have a slightly different name. :)