Skip to content
Write Software, Well
  • Services
  • Books
  • Archive
  • About
Sign in Subscribe

Understanding Authenticity Tokens in Rails

This post explores CSRF vulnerability and how Rails mitigates it using authenticity tokens. We will will learn why they're needed, how they're generated, how Rails uses them to verify the requests, and how to disable them for specific requests.

1 min read

Metaprogramming in Ruby

Metaprogramming in Ruby enables you to produce elegant, clean, and beautiful programs as well as unreadable, complex code that’s not maintainable. This book teaches you the powerful metaprogramming concepts in Ruby, and how to use them judiciously.

6 min read

How to Get an Object's Class Name in Rails

This post explores a few different ways in which you can get an object's class name in both Ruby and Rails.

1 min read

A Deep Dive Into Database Migrations in Rails

Like source code, database schema changes and evolves over time. Migrations are a feature of Active Record that allows you to manage the database schema

4 min read

Attributes API in Rails

Sometimes, you want to set default values on your ActiveRecord objects and convert them to a different type. Rails provides a handy attribute method that

1 min read

How to Get the Current Absolute URL in Rails

Every Rails controller includes two accessor methods pointing to the request and the response objects associated with the current HTTP request cycle. The request method

1 min read
Rename Database Column in Rails

How to Rename a Database Column in Rails

Solution 1: Undo Last Migration If it is a simple typo in the last migration, use the db:rollback command to undo the last change.

2 min read
Rails Controller Hierarchy

Metal Controller in Rails

The ActionController::Base class is the great-grandfather of all Rails controllers, but doesn't get much attention. In this post, we will examine this Metal class and how it works. We'll also trace the path of an incoming HTTP request to Rails controllers.

1 min read
active job framework in rails

Active Job: How Does It Work?

In this article, I explain the journey of a background job, from its creation to execution. We will learn how it’s configured and enqueued, and how an adapter invokes it. We will also see the different ways to configure a job.

1 min read

Up and Running with Minitest

I love minitest. Minitest is simple. There’re a few ways to write tests, and they are so intuitive. I learned it last year, when

1 min read
&method shortcut in ruby

Ruby Shortcut to Call a Method with Each Array Item as Parameter

As a Ruby programmer, you probably know the &: shortcut to call a method on each item in an array. For example, this snippet will

Ruby Gems 2 min read

How to Manage Environment Variables in Rails

Now you might think it’s so easy to access them using the ENV hash. Why do we need a different way? Well, a very

1 min read

Page 14 of 16

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

© Write Software, Well 2025 - Powered by Ghost