September 8, 2020
This blog is part of our Rails 6.1 series.
rails new my_app
creates a new Rails application fully loaded with all the
features.
If we want to omit some of the features then we needed to skip them like this.
# before Rails 6.1
$ rails new tiny_app
--skip-action-cable
--skip-action-mailer
--skip-action-mailbox
--skip-action-text
--skip-active-storage
--skip-bootsnap
--skip-javascript
--skip-spring
--skip-system-test
--skip-webpack-install
--skip-turbolinks
Before Rails 6.1 it was not possible to skip things like active_job
and
jbuilder
.
Rails 6.1 added a new option --minimal
.
$ rails new tiny_app --minimal
All the following are excluded from this minimal Rails application.
We can bundle webpack in this minimal app like this.
$ rails new tiny_app --minimal webpack=react
Database option can also be passed.
$ rails new tiny_app --minimal --database postgresql webpack=react
Check out the pull request for more details on this.
If this blog was helpful, check out our full blog archive.