Ruby on Rails: templates and generators in 2020
Reinventing the wheel does not make sense..
Every time when you start a new rails project you have to repeat everything over again:
- install devise
- add Stimulus/React/Vue
- add Boostrap/Tailwind
- add FontAwesome
- configure ActiveStorage
- configure ActionMailer
- connect sendgrid/mailgun AND THE LIST GOES ON…
There are 2 kinds of solutions solving this problem:
- Generators - run a script to install a certain feature
- Boilerplate apps - clone an app with pre-configured defaults
Below are the most prominent ones
run a command like
rails app:template LOCATION=https://www.rubidium.io/templates/bootstrap-v4/consume
to install bootstrap.
No gems or installation required.
The website contains lots of different templates to install different gems and features.
Built by the Driftingruby author.
great, just like above! Run a command like
rails app:template LOCATION=’https://railsbytes.com/script/x9Qsqx’ to install bootstrap. No gems or installation required. It’s easy to contribute and add your own template to the list! Built by Chris from Gorails.
boring generators gem
a new gem containing different templates, that you install into the development environment.
Run a command like
rails generate boring:bootstrap:install to install bootstrap.
This project is good in comparison to the ones above, because it is completely open source.
Of course, all the solutions above are built based on the official Rails Application Templates and Rails Generators docs, that are definitely worth exploring:
2. Boilerplate apps
one of the first boilerplates you find as a RoR developer.
OUTDATED and NOT RECOMMENDED for new projects.
well maintained boilerplate with a lot of pre-configured defaults.
an up-to-date boilerplate with good docs and a vibrant community. Source code worth studying.
Rails 6 boilerplate with schema-level multitenancy, Stimulus, Docker
And many more! Like rails_6_github_template
very fresh Rails 6 boilerplate with Stimulus, Tailwind and more.
2020 is a being a very rich year for the development of competitive Ruby on Rails boilerplates and generators. What can I say, it’s a great community!
Special thanks to the authors of the above projects: