I have an index action which lists out all the items on a page. The page has an alphabet bar at the top, so on the first page load it only loads all the A’s. The letters allow the user to choose what starting letter they prefer to view.
the problem is that each time a letter is clicked the page does a full reload.
What would the simplest way of loading the items of a new letter and replacing the current items?
Thanks for the reply. So could I set the pjax container in the index view layout rather than around my main yield call? so it only 'pjax’ifies one specific part?
Untested, but something like that would work.
Load the response into an element on the page, update the URL with pushState, only return the content from the server.
Just tried this. I added pjax_rails to my gemfile, bundle installed, added pjax in my application.js file and added data-pjax=“.coasters-list” to my links
However, clicking the links performs a full page load.