Tutorials

Streaming LLM Responses with Rails: SSE vs. Turbo Streams
In the world of Rails development, integrating large language models (LLMs) like OpenAI's GPT has become increasingly common. One challenge developers face is streaming these responses efficiently to provide a smooth user experience.
This post wi...

Turbo Drive, Frames, Streams, Morph? What to use?! | Rails Designer
The Hotwire trifecta allows you to write modern (Rails) web apps, without the need to write (a lot of) cumbersome JavaScript with Turbo’s Drive, Frames, Streams or Morph. But with all these options, which one to use and when?
Hotwire, like Rails,...

Setting Up Rails With Dev Containers - FastRuby.io | Rails Upgrade Service
Having reproducible development environments is one of the best ways to guarantee ease of application setup and code sharing in teams. Dev containers are a way to achieve this.
In this article we’ll try to give you a small introduction to what de...


Improving Rails Migrations Using bulk: true - Mintbit
When working with Rails migrations, performance isn’t usually the first thing that comes to mind—until your schema starts getting big or you’re deploying changes to production environments with large databases. Fortunately, Rails provides a simple...

Use getter methods instead of instance variables in Ruby objects
When I think about a Ruby object I try to minimize the public methods that it exposes. My line of thinking is that all methods should be private unless there is a real reason to make that method public.
When making a method public you are signing...


Understanding Ruby’s `tap` — A Powerful Debugging and Configuration Tool - Harisankar P S | Ruby on Rails Developer
Ruby’s Object#tap is a small but powerful method that often goes unnoticed. It allows you to “tap into” a method chain, perform some operation, and return the original object—regardless of what the block inside returns. This makes it particularly ...

Fix N+1 Queries Without Eager Loading Using SQL Subquery
In this post, we'll learn how to use a SQL subquery in a Rails app to eliminate N+1 queries and improve performance. We'll profile a real-world example, showing how to fetch a single record from associated has_many records efficiently without eage...

Sanitize your strings in JavaScript like a Rails developer | Rails Designer
Bring a little Rails into your JavaScript with super useful sanitize method to strip unwanting characters from your content.Ruby (and Rails) are known for great Developer Experience. Not in the least because of the many little helpers available. J...