Spreading the joy of writing software using Ruby and Rails with the world.| Write Software, Well
A root route specifies what should happen when someone visits the home page of your application. This post shows how to add a root route.| Write Software, Well
This post shows how you can redirect incoming HTTP requests using the Rails router with the help of the redirect() method.| Write Software, Well
Shallow nesting lets you avoid deep nesting by generating the collection actions scoped under the parent, but by not nesting the member actions.| Write Software, Well
If you want to map a resourceful route to another controller class in Rails, you can do so by passing the controller option to the resources method.| Write Software, Well
Rails allows you to nest a resource within another resource to express the logical relationship between them. This post shows how nested resources work in Rails.| Write Software, Well
You can list all the routes in your Rails application by running the `bin/rails routes` command in the terminal. or by visiting `/rails/info/routes` path on a running Rails application.| Write Software, Well
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.| Write Software, Well
This post shows how you can override the default named parameter :id in Rails, by overriding the `to_param` method on the Rails model.| Write Software, Well
This post explains named routes in Rails. We'll learn how you can name a route, and how you can use the named helper methods to generate URLs corresponding to the route.| Write Software, Well
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.| Write Software, Well
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.| Write Software, Well
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.| Write Software, Well