SPA like user experience without a client side framework (in Ruby on Rails)
- Fast in-app navigation with Turbolinks
- Ajax requests created with rails-ujs and Server-generated JavaScript Responses (SJR)
- Interactive HTML with Stimulus JS
<a href> links to the same domain • Prevents the default click action and creates an Ajax request instead • Replaces the current <body> element and merges <head> element
Ajax request 2. Process it on the server (save the data, etc.) 3. Generate a JavaScript response with updated HTML 4. Evaluate the response and update the DOM
true, method: :delete, confirm: "Are you sure?" } %> <a href="/users/new" data-remote="true" data-method="delete" data-confirm="Are you sure?"> New user </a>