Skip to content

Blogging On Rails

Everything on Rails!

Adding Loading Screen with Turbo

One great aspect of Turbo frames is lazy loading. You can use this behavior to quickly load in the shell of a UI, and then lazy load all the data. Adding an animating loading status will help give the feeling of immediacy and “a lot of work is happening in the background” without the frustrationContinue reading “Adding Loading Screen with Turbo”

Read More

Interactive HOTWire Notifications with Turbo Streams

Rails’ use of flash messages is a great way to provide context for customer actions. If they delete an object, flashing a notice that the delete action succeeded, or perhaps failed, gives them more context to make the next decision. With HOTWire’s asynchronous nature, you don’t get those notifications in the same way, especially ifContinue reading “Interactive HOTWire Notifications with Turbo Streams”

Read More

Stimulus.js & HOTWire Tutorial: Interactive Deletes

Interactive websites have that feeling of immediacy. Clicked links respond in milliseconds, and there is never a need to wait… Waiting for a remote record to delete, and then the whole page refresh afterwards can feel like an eternity in web’s modernity.

Read More

Interactive HOTWired paginated deletes

When you have a lot of records, it makes sense to paginate the table. That way, instead of loading thousands of records, you can load a subset, with better performance, and allow your user to move through the pages as leisure. It’s also better for usability, because it’s easier to go back to a particularContinue reading “Interactive HOTWired paginated deletes”

Read More

HOTWiring an existing Rails Monolith: Forms!

Let’s say your majestic monolith is looking for more interactivity, and you’ve picked up Turbo. What aspects of a Rails app change that may cause some headaches? Add Turbo, and then follow along! Forms First, you need to test all your forms. Turbo dramatically changes the behavior of each form. The biggest change you willContinue reading “HOTWiring an existing Rails Monolith: Forms!”

Read More

HOTWiring an Existing Rails Monolith

How do you add Turbo to your existing Rails app? What do you need to watch out for as you transition to a full HOTWire approach? I found it to be very straight forward, and mostly a search and replace operation. Add Turbo Rails gem to the Gemfile and remove Turbolinks: Then run ./bin/bundle installContinue reading “HOTWiring an Existing Rails Monolith”

Read More

Improving Performance with Russian Doll Caching HOTWire Tutorial #6

Now that the HOTWire Hacker News Progressive Web App loads in the comments asynchronously, you should experience the slow loading on the comments page. Since each level of comments can load another level of comments, it will feel slow as everything loads into the page in chunks. You’ll also notice that the comments are alwaysContinue reading “Improving Performance with Russian Doll Caching HOTWire Tutorial #6”

Read More

Lazy Loading Lots of Comments HOTWire Tutorial #5

As we continue in building out the HOTWire Hacker News Progressive Web App, it’s time to look at loading the comments. This is an interesting data problem, because each item has comments, and each comment has comments, and you can go recursively until you run out. The original HNWPA pushed all the comment loading intoContinue reading “Lazy Loading Lots of Comments HOTWire Tutorial #5”

Read More