While Local Storage is great, it’s not ideal: it only stores data on the computer from which the user is accessing the page. This approach does not allow for the app to ‘remember’ anything when the same user tries to access it again from a different device. For that, you’re going to need a real backend.
By the end of this lesson, you should be able to:
- Explain why you should use AJAX to load large batches of data
Since you’ve already learned Ruby on Rails in our full-stack Ruby on Rails path, the next step is obvious: you get to build your own backend with Rails! In preparation, reread the Rails lesson on building an API to refresh how to set up a Rails backend that can handle JSON requests.
content_forstuff at the bottom.
Refresh yourself on Rails AJAX from RailsGuides (just skim the top few sections).
Read Bootstrapping JSON data into a Rails View to learn about passing data to your front end.
This section contains helpful links to other content. It isn’t required, so consider it supplemental.