A modern web application has many moving parts, Ruby on Rails is no exception. With a new Ruby on Rails 6.1 application there’s a lot you get for free.
What you get for free:
- Outgoing email handling (
- Incoming email handling (
- Text markup / editing in the browser that works (
- Making use of the whole NPM ecosystem for front-end technology (
- Background workers (
- Websockets with fallback (
- An awesome DSL to generate JSON (
- Make your application load faster in the browser (
- Increase performance by caching expensive computations (
- Application pre-loader (
- Store files locally or in the cloud (
However, there are times you want to start with something simpler, without the burden of all these extras.
A minimal approach
You could use all the
--skip-* options to disable each of these, but
Rails 6.1. packs the
--minimal option instead:
1 rails new my_app --minimal
It should be noted that this does not imply a classic Rails app, as DHH eloquently put it:
Classic gives it an air of cool that I’m not interested in. It’s not about reminiscing of some glorious past. It’s just “I want the bare minimum”
That bare minimum is a great starting point if you’re not yet ready for all the goodies and maybe uncertain whether you’re going to need them at all. Adding the ones you need later it just like adding any other gem to your Rails project.
I’m a big proponent of this approach, as less dependencies (you don’t use) means your codebase will be easier to maintain and upgrade in the future.
More points with combos!
If you’re really into front-end and would like to use webpacker with a minimal Rails app, that’s possible too. Selecting a specific database adapter is also still possible.
1 rails new cool_app --minimal --database postgresql webpack=react