Once I learned that it didn't mean "Rails bites," I stopped what I had set out to work on that raining Sunday and shifted all my attention to Rails Bytes.
Rails Bytes is a repository of hosted Ruby on Rails templates.
- Sometimes I swap out Minitest for RSpec; sometimes, I don't.
- Sometimes I use Devise; sometimes, I don't.
- Sometimes I use Draper; sometimes, I don't.
- Sometimes I take payments with Pay; sometimes, I don't.
- I (mostly) always use Factory Bot and Pry.
I'm grateful for how easy it is to make these additions/changes in Ruby and Rails. However, it still takes time to find a library, look for the gem name (underscore or dash?), add it to my Gemfile, bundle install, and then go through all the library-specific setup instructions.
Chris and I started hacking on the free Jumpstart template in 2017 to make some of these decisions when starting a new Rails app. When I fizzled out, Chris open-sourced it and championed it into a fantastic resource for bootstrapping a new Rails application. Many developers have given back to Jumpstart, and it's a solid template.
The problem I've run into over the last couple of years, though, is that I often don't know what libraries I want to use until I've started building the application.
Rails Bytes shines, here.
I can use (or create!) pre-built Rails templates that do one thing, and they do it well.
If I want to add Devise to my existing application, I can run
rails app:template LOCATION='https://railsbytes.com/script/X8Bsjx'.
If I want to swap out Minitest for Rspec I can run
rails app:template LOCATION='https://railsbytes.com/script/z0gsLX'.
If I want to add TailwindCSS I can run
rails app:template LOCATION='https://railsbytes.com/script/z5OsqV'.
These templates don't just install a gem and run the
rails g command. Many of them also prompt you for extra configuration options and do the work required to get the libraries up and running. 🙌
The benefit to tiny, single-focused templates is that they're composable! 😱 I watched Andrew wire up RSpec, Factory Bot, and Standard into a single template.
It's still early, but I'm excited about the future of Rails Bytes. I can't wait to see what templates my fellow Rubyists (you!) build to make our lives easier.
I host a podcast with Chris and work with Andrew at Podia, so I may be biased. However, I'm incredibly excited about this project. So much so that I can't stop thinking about it and I'm learning how to write a DEV.to article about it!