Skip to content
Write Software, Well
  • Services
  • Books
  • LinkedIn
  • Archive
  • About
Sign in Subscribe
Can you spot the error in this Ruby code?

Can You Spot the Error?

I recently encountered this error and in the process of debugging, learned some useful stuff about `self` and how assignment works in Ruby. See if you can figure it out yourself. Can you spot the error in this simple Ruby snippet?

2 min read
Books to learn programming with Ruby and Rails

A List of Books to Learn Programming with Ruby and Rails

This post provides a curated list of books to learn to code in Ruby and build web applications with Rails. It also gives a step-by-step path you can follow to learn enough before moving to the next step. If you ever wanted to learn to program but didn't know where to start, this post is for you.

9 min read
Using OrderedOption to access hash values as methods

How to Access Hash Values with Methods Using OrderedOptions

Have you ever wanted to create a hash where you could access the values like methods on an object? The OrderedOptions class in Rails lets you do just that. This post shows you how. We'll also explore how Rails implements this feature using Ruby's metaprogramming features.

Rails Internals 5 min read
The Definitive Guide to Rack for Rails Developers

The Definitive Guide to Rack for Rails Developers

The word Rack actually refers to two things: a protocol and a gem. This article explains pretty much everything you need to know about Rack as a Rails developer. We will start by understanding the problem Rack solves and move to more advanced concepts like middleware and the Rack DSL.

This article is for Members only

12 min read

Readonly Attributes in Rails

In this article, we'll learn how to mark certain attributes as readonly on your active record models, to prevent them from any future updates after the record is created and saved to the database. We'll also learn how Rails implements this feature behind the scenes.

Rails Internals 3 min read
Sessions in Rails: Everything You Need to Know

Sessions in Rails: Everything You Need to Know

In this post, we’ll learn about Rails sessions, including what is a session, why we need them, and why they're so important. I’ll also take you behind the scenes and show you how Rails implements sessions and where the `session` method actually comes from. Hint: it’s not in the Rails codebase.

10 min read
Attribute Assignment in Rails

Understanding the Attribute Assignment API in Rails

In this post, we will explore the `AttributeAssignment` module in Rails, which allows you to set an object's attributes by passing in a hash, a feature commonly used by Active Record models. We'll also learn a little metaprogramming along the way.

Rails Internals 3 min read
A Counter to Track Your Habits

Progressive Application Development with Hotwire

This is the day when you fall in love with Hotwire. We're going to build a simple counter. But we're not going to build it once and be done with it. Instead, we'll build and progressively enhance it with all three frameworks in Hotwire: Turbo Drive, Turbo Frames, and Turbo Streams.

Hotwire 21 min read
Rails Environments

Configuring Rails Environments

Despite its strong opinions and powerful conventions, Rails is a highly flexible and configurable framework. If you don’t like something, there’s almost certainly a way to change it. This article provides a brief overview of configuring Rails applications and environments.

9 min read
Turbo Streams Demo Application

Turbo Streams: How They Work and Differ From Turbo Frames

No, you don’t need WebSockets to use Turbo Streams. You can simply use them to deliver multiple page updates with a single HTML response. This article teaches the basics of Turbo Streams to build a SPA without writing a single line of JavaScript. No Rails needed, either!

Hotwire 14 min read
Hotwire: HTML Over the Wire

A Brief Introduction to Hotwire

Hotwire, which stands for HTML Over the Wire, provides a different way to build modern web applications without using too much JavaScript. This article provides a quick introduction to Hotwire and its component frameworks, such as Turbo Drive, Frames, and Streams.

Hotwire 8 min read
Authenticity Tokens in Rails

How Rails Authenticity Tokens Protect Against CSRF Vulnerability

Rails protects your web application from CSRF attack by including an authenticity token in the HTML forms. This token is also stored in the user's session. Upon receiving a request, Rails compares these two tokens to decide if the request is verified.

Rails Internals 6 min read

Page 12 of 18

Load More Something went wrong with loading more posts
  • Sign up
  • Homepage

© Write Software, Well 2025 - Powered by Ghost