This site is about programming(mostly) things I either do or am learning.
14 Mar 2018 | | rails
… there’s a big difference between a) keeping up with open source, and b) hitching your cart to every horse that struts by with shiny new shoes…Jerod Santo/changelog.com
Turbolinks was created by DHH with rails 4.0 in 2012 and was inspired by pjax. Its purpose basically was to make displaying portions of a webpage faster/more efficient using AJAX.
### How it works In its basic form, rails creates an HTML page on the server, and then renders it sending it to the browser. Using Turbolinks, the same approach is used.
Turbolinks does pretty much the same thing: It intercepts all <a> links and makes an AJAX request, gets the response and renders it. The window, document, and <html> element persist from one render cycle to the next. The history API is used to keep the browser URL in sync. #### Form submissions Turbolinks does not “do” form submissions, but rails itself already handles that and with version 5 AJAX submitted forms are the default. #### Some highlights