Skip to content
Write Software, Well
  • Services
  • Books
  • LinkedIn
  • Archive
  • About
Sign in Subscribe
The Rails Router Handbook

The Rails Router Handbook

For the past few days, I've been trying to learn everything I could about the Rails router. I compiled all of my notes together with the past articles on this blog, and published a handbook on the router. I hope you find it useful and you learn a thing or two about the incredible Rails Router.

4 min read
Rails Routing Concerns

Routing Concerns in Rails

You must have used concerns in Rails. Did you know you can also use concerns for your routes? They allow you to declare common routes to be reused in other resources and routes. This post covers the basics of routing concerns, including what they are, how they work, and when you might need them.

Router 3 min read
Shallow Nested Routes in Rails

Understanding Shallow Nested Routes in Rails

Avoid deeply nested routes in Rails with shallow nesting. Keep the routes that list/create records scoped under the parent resource. For routes acting on a single record, don’t include the parent in the URL. Instead, use only what’s necessary to uniquely identify that record, keeping routes shorter.

Router 3 min read
Resourceful Routes in Rails

Working with Resourceful Routes in Ruby on Rails

The concept of resourceful routing took me a long time to understand, but once it clicked, it changed how I viewed web applications. This post covers the basics: what a resource is, the routes it generates and how resourceful routing provides a nice organizational structure your Rails applications.

Router 7 min read
Routing to a Rack Application in Rails

How to Route an Incoming URL to a Rack Application in Rails

The Rails router can dispatch an HTTP request to a Rack endpoint, either in your application or within a gem. This is useful when you want to provide a well-isolated web UI or front-end to the users of your gem. In this post, we'll learn why you may want to do this, how it works, and how to do it.

Router 7 min read
Map a Resourceful Route in Rails to Another Controller Class

Map a Resourceful Route in Rails to Another Controller Class

You can map a resource to a different controller by passing the controller option to the resources method.

Router 1 min read
Nested Resources in Rails

Working with Nested Resources in Ruby on Rails

Nested resources in Rails model parent–child relationships in routes, like comments under posts. They make intent clear and improve semantics, but should be used sparingly. Shallow nesting keeps URLs readable and controllers simpler.

Router 3 min read
List and Filter Routes in Rails

How to List and Filter Routes in Ruby on Rails

This post shows how you can list all the routes in your Rails application and find or filter them using the grep option.

Router 2 min read
Match Method in Rails Router

Understanding the Match Method in Rails Router

In this post, we will learn about the match method, which forms the core of the Rails router. We'll also explore how the match method works behind the scenes. Once you really understand the match method and its options, the rest of the routing methods and shorthands become very easy to understand.

Router 5 min read
How to Override the Named Route Parameter ID in Rails

How to Override the Named Route Parameter ID in Rails

This post is part of my handbook on the Rails Router.The Rails RouterEverything you need to know about the incredible routing system in Rails.

Router 3 min read
Rails Named Routes

Understanding Named Routes in Rails

💡This post is part of my handbook on the Rails Router.The Rails RouterEverything you need to know about the incredible routing system in Rails.

Router 2 min read
Rails Root Route

How to Add a root Route in Rails

💡This post is part of my handbook on the Rails Router.The Rails RouterEverything you need to know about the incredible routing system in Rails.

Router 2 min read

Page 4 of 18

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

© Write Software, Well 2026 - Powered by Ghost