Tutorials




What to do when you need a button_to within a form in Rails
Imagine that you have a form to update a record (let’s say a product record) and inside the form, you are showing a list of images, and each image needs a button to remove it. You tried to use button_to but it doesn’t work because in html you can.

Are you absolutely sure your `has_one` association really has one association?
Learn about an unexpected limitation with this API and how to combat it universally.The Rails has_one API has an unexpected limitation: It does not prevent multiple records from being associated to the parent record.Take this simple example straig...

How to improve and standardize writing services in Ruby project - DEV Community
In this short note, I want to share with you a way to create services of any complexity in Ruby... Tagged with ruby, rails.Everything to know about Servactory gem.Repository in GitHub: github.com/afuno/servactoryDocumentation: servactory.comThe li...

Lazy Loading with Stimulus and Tailwind | Ruby on Rails 7 Tutorial - YouTube
Lazy load with a spinning widget and placeholder templates in this Stimulus and Tailwind, Ruby on Rails 7 tutorial!Checkout my course(s) at: https://learn.deanin.comSource:https://github.com/Deanout/lazy_loadingLinks:https://www.stimulus-component...

How to migrate AASM to ENUM while keeping users in mind - DEV Community
In this article, we will address a common challenge when migrating from the AASM state machine to the Rails built-in enum. The main problem we aim to solve is ensuring a seamless transition without causing disruptions or data inconsistencies for u...


Really, Really, Really Don’t Interpolate Strings into Active Record Methods - Andy Croll
Protecting your application against malicious users is one of your key responsibilites as a developer. The built-in security provided by a well-maintained framework, such as Rails, is an excellent reason to use one.This is particularly true of the...