Building single-page web applications
with Ruby on Rails
What are single-page apps?
The pursuit of better user experience changes the way we think about browsing the web. As the Internet matures, we abandon the classic approach whereby the user is presented with a handful of URLs which reload the page when clicked; the new approach aims to make the web application work seamlessly. This is achieved by retrieving all the code needed with a single-page load and, subsequently, changing only some elements on the page, depending on the actions taken by the user. Such an approach has a few benefits. It ensures a fine-grained control over the user experience as it eliminates network latencies and disruptions caused by page redraws. It can also save resources like bandwidth and CPU time on the server side.
There are various techniques which allow to retain a single-page during the client-server communication process. On a higher level of abstraction, the main difference between these techniques boils down to the opposition: “thick server architecture vs. thin server architecture” or “fat client vs. thin client”. A “fat client” is able to perform many tasks without accessing the server. In contrast, a thin client, generally, does as little processing as possible and depends on connecting to the server each time user input needs to be processed or validated.