Rails without tha added sugar

Ariejan de vroomPosted by Ariejan de Vroom on 21-1-2021

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:

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
Ariejan de vroom

Ariejan de Vroom

Software Engineer • CodeRetreat Facilitator • Ruby, Go and C Programmer • Electronics Apprentice

Bij Kabisa staat privacy hoog in het vaandel. Wij vinden het belangrijk dat er zorgvuldig wordt omgegaan met de data die onze bezoekers achterlaten. Zo zult u op onze website geen tracking-cookies vinden van third-parties zoals Facebook, Hotjar of Hubspot. Er worden alleen cookies geplaatst van Google en Vimeo. Deze worden gebruikt voor analyses, om zo de gebruikerservaring van onze websitebezoekers te kunnen verbeteren. Tevens zorgen deze cookies ervoor dat er relevante advertenties worden getoond. Lees meer over het gebruik van cookies in ons privacy statement.