Uploaded January 2025 | Updated September 2026, 2 weeks ago
You win some; you lose some.
In this video, I submit two contributions to Rails. One of them ends up getting accepted and the other rejected. Even when your contribution isn't accepted, you can still learn something.
The issue was discovered while working through the beta version of Agile Web Development with Rails 8 by Sam Ruby and Dave Thomas. The Rails routing guide indicates that it is a best practice for Rails development to avoid having unused resource routes in your routing configuration. It would make sense for the code produced by Rails generators to follow best practices, so I saw an opportunity to contribute and improve the project.
In addition to the changes to the authentication generator, I found a typo in the routing guide. As we'll see by the end of the video, it's important to keep these contributions separate and independent in case some of them are not accepted.
The Rails development landscape has changed somewhat since my previous contribution in 2020-2021 on the scaffold generator. Now we can use Development Containers instead of the Rails Dev Box to make and test our contributions. The same basic process remains in place, but we condensed the process that took seven videos for the previous contribution down to one.
In the end, the authentication generator contribution is rejected and the typo fix is accepted and merged into the main branch of Rails.
This video covers:
00:00:00 Introduction
00:03:06 Show where in the Rails codebase we're attempting to make the change
00:04:28 Explanation of why to remove unused routes
00:06:05 Review the Contributing to Ruby on Rails guide
00:07:24 Demonstrate the issue with a new Rails 8 application
00:10:24 Fork or update from rails/rails
00:11:22 Clone the forked repo to the local computer (with a few errors along the way)
00:12:24 Open the Rails repo as a dev container in Visual Studio Code
00:14:23 Make changes to the generator code and tests
00:20:34 Using Rubular to validate the matching expression for the tests and run the modified tests
00:22:13 Create a new app using the local fork of rails to test and validate the behavior
00:26:48 Explain plan for contribution and create issue in Rails
00:29:54 Commit code for auth generator contribution
00:31:20 Update changelog, amend commit, and push to forked repo
00:34:19 Create pull request for auth generator contribution
00:36:05 Make change and create pull request for routing guide typo fix
00:40:50 Epilogue: One-for-two on contributions
#ruby #rails8 #rails #rubyonrails #rubygems #codecast #screencast #github #opensource #minitest #softwaredevelopment #learntocode #railties #devcontainers #guides #documentation #generators
See other related StatelessCode videos:
- Rails 8 Development with Dev Containers and rails-new youtu.be/NWNLU4FxnNc
Featured Playlist:
- Contributing to Rails youtube.com/playlist?list=PL9kkbu1kLUeMwz4MNSb1Ntwe4eU_y3U8Q
Resources that we relied upon for this solution:
- Rails Routing from the Outside In guides.rubyonrails.org/routing.html
- Contributing to Ruby on Rails guides.rubyonrails.org/contributing_to_ruby_on_rails.html
- Rubular (Ruby regular expression editor) rubular.com
Rails Issue, and Pull Requests:
Issue: github.com/rails/rails/issues/54233
Rejected Pull Request for Authentication Generator: github.com/rails/rails/pull/54234
Accepted Pull Request for Routing Guide: github.com/rails/rails/pull/54235
Mike's learning repo for Agile Web Development with Rails 8:
github.com/msducheminjr/agile_rails_8_training
This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.
You win some; you lose some.
In this video, I submit two contributions to Rails. One of them ends up getting accepted and the other rejected. Even when your contribution isn't accepted, you can still learn something.
The issue was discovered while working through the beta version of Agile Web Development with Rails 8 by Sam Ruby and Dave Thomas. The Rails routing guide indicates that it is a best practice for Rails development to avoid having unused resource routes in your routing configuration. It would make sense for the code produced by Rails generators to follow best practices, so I saw an opportunity to contribute and improve the project.
In addition to the changes to the authentication generator, I found a typo in the routing guide. As we'll see by the end of the video, it's important to keep these contributions separate and independent in case some of them are not accepted.
The Rails development landscape has changed somewhat since my previous contribution in 2020-2021 on the scaffold generator. Now we can use Development Containers instead of the Rails Dev Box to make and test our contributions. The same basic process remains in place, but we condensed the process that took seven videos for the previous contribution down to one.
In the end, the authentication generator contribution is rejected and the typo fix is accepted and merged into the main branch of Rails.
This video covers:
00:00:00 Introduction
00:03:06 Show where in the Rails codebase we're attempting to make the change
00:04:28 Explanation of why to remove unused routes
00:06:05 Review the Contributing to Ruby on Rails guide
00:07:24 Demonstrate the issue with a new Rails 8 application
00:10:24 Fork or update from rails/rails
00:11:22 Clone the forked repo to the local computer (with a few errors along the way)
00:12:24 Open the Rails repo as a dev container in Visual Studio Code
00:14:23 Make changes to the generator code and tests
00:20:34 Using Rubular to validate the matching expression for the tests and run the modified tests
00:22:13 Create a new app using the local fork of rails to test and validate the behavior
00:26:48 Explain plan for contribution and create issue in Rails
00:29:54 Commit code for auth generator contribution
00:31:20 Update changelog, amend commit, and push to forked repo
00:34:19 Create pull request for auth generator contribution
00:36:05 Make change and create pull request for routing guide typo fix
00:40:50 Epilogue: One-for-two on contributions
#ruby #rails8 #rails #rubyonrails #rubygems #codecast #screencast #github #opensource #minitest #softwaredevelopment #learntocode #railties #devcontainers #guides #documentation #generators
See other related StatelessCode videos:
- Rails 8 Development with Dev Containers and rails-new youtu.be/NWNLU4FxnNc
Featured Playlist:
- Contributing to Rails youtube.com/playlist?list=PL9kkbu1kLUeMwz4MNSb1Ntwe4eU_y3U8Q
Resources that we relied upon for this solution:
- Rails Routing from the Outside In guides.rubyonrails.org/routing.html
- Contributing to Ruby on Rails guides.rubyonrails.org/contributing_to_ruby_on_rails.html
- Rubular (Ruby regular expression editor) rubular.com
Rails Issue, and Pull Requests:
Issue: github.com/rails/rails/issues/54233
Rejected Pull Request for Authentication Generator: github.com/rails/rails/pull/54234
Accepted Pull Request for Routing Guide: github.com/rails/rails/pull/54235
Mike's learning repo for Agile Web Development with Rails 8:
github.com/msducheminjr/agile_rails_8_training
This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.










