/hotrails.dev-tutorial

https://www.hotrails.dev/turbo-rails

Primary LanguageRuby

Hotrails.dev Tutorial

Builds a single-page, reactive quote editor with only a single line of custom JavaScript for the flash message animation (https://www.hotrails.dev/quotes)

Notes

  • Turbo gives you the speed of a single-page web application without having to write any JavaScript.
  • Get the benefits from React with a tenth of the effort.
  • With the release of Ruby on Rails 7 in December 2021, Hotwire, which is the combination of Stimulus and Turbo, became the default front-end framework for Rails applications.
  • Turbo and its integration for Ruby on Rails are brand new tools with impressive features.
    1. All clicks on links and form submissions are now AJAX requests, which speeds up our applications thanks to Turbo Drive. We get this benefit for free as it does not require any work; we only have to import the library.
    2. It is now effortless, with just a few lines of code to build dynamic applications by slicing pages in different pieces with Turbo Frames. We develop our CRUD controllers just like we did before, and just by adding a few lines of code, we can replace or lazy-load independent parts of the page!
    3. It becomes trivial to add real-time features with the help of Turbo Streams. Want to add real-time notifications to your application, build a real-time multiplayer game, or a real-time bug monitoring system? The real-time part is just a few lines of code with Turbo!
  • Turbo speeds up Rails applications, reduces the amount of JavaScript we have to write, and makes it easy to work with real-time features.