Coming soon!

This lesson will be released on February 11, 2026.

Clean Up Optional Attributes in Rails with Normalizes

February 11, 2026 Coming soon

Track your progress

Sign in to track your progress and access subscription-only lessons.

Log In

Your Teacher

Hi, I'm Chris. I'm the creator of GoRails, Hatchbox.io and Jumpstart. I spend my time creating tutorials and tools to help Ruby on Rails developers build apps better and faster.

About This Episode

Optional attributes are empty strings by default, but we can clean these up as nil in Rails using normalizes

Notes

class Example < ApplicationRecord
  normalizes :optional_attribute, with: -> { it.presence }
end