Happy Birthday, Rails! 🎉

Fifteen years ago, in August 2009, I worked for a small network provider company. I was a junior developer, yes 15 years ago, junior devs didn’t become seniors in 3 months. We used Dolphin SmallTalk for our internal systems, and I had the task of creating a simple web application for our customers. Also in the summer, but 20 years ago in July 2004, David Heinemeier Hansson released the first version of Ruby on Rails. I watched this video, and my life has changed.

Writebook by Once

Today, we’re diving into the Writebook project from ONCE.com by 37 Signals. I’ll take you through the code, showing you how it’s all put together. Whether you’re new to Ruby or have been at it for a while, you’ll find some cool tips and tricks in this walkthrough.

Rails String#upcase_first VS capitalize and titleize

What comes in your mind when you have a task to make the first letter of a string uppercase? You might think about using capitalize method, or titleize method.

In one of my recent projects, we’ve been asked to ensure first capital letter in first and last name of a user. Sounds simple right? We’ve used Rails 7.1 normalization API together with String#titleize.

Validate belongs_to association in Rails

Eight years ago, Rails 5 made the belongs_to association required by default. This solved a lot of problems with orphaned records in the database. But sometimes, you need to have an optional association, which may lead to situations that you don’t expect.