Skip to content
This repository has been archived by the owner on Oct 11, 2019. It is now read-only.

Dynamic content and Ajax links create new pages #103

Open
keithnickas opened this issue May 7, 2015 · 0 comments
Open

Dynamic content and Ajax links create new pages #103

keithnickas opened this issue May 7, 2015 · 0 comments

Comments

@keithnickas
Copy link

Issue discovered with #102

I've been looking through the issues and found one that was similar: #40 but my problem is with how the URLs are being handled for a ajax method.

Our site uses an ajax call via Kaminari pagination to load additional data into the index page via a link_to_next_page helper; normal behavior would insert the additional data into the index page with a CSS transition. The transition works fine, however, the user is redirected to an associated link.

Root:

http://localhost:3000/san-francisco

Links (links contain data-push="true" and data-target="#main-content"):
  1. http://localhost:3000/san-francisco?page=2
  2. http://localhost:3000/san-francisco?page=3&_=1431025498939
Upon click:

Location updates to: http://localhost:3000/san-francisco?page=2
Page is redirected and scrolls to the previous viewport position instead of to the top of the page causing elements to not be seen by the user


Wiselinks seems to be what I'm looking for as a solution, however, it that would need to allow for dynamic content to be loaded onto the same page and hold as a history state. I am open to suggestions on how to accomplish this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant