Rob Zolkos avatar

Rob Zolkos

October 11, 2021

Rails 'new' customizations for Rails 7

With Rails 7 and its plethora of new javascript and css configuration options and flags, it can be quite challenging to remember just what these options are when creating a new app.

For quite some time Rails has had the ability to read in a config file you have in your home folder named .railsrc This file contains the various flags you would otherwise pass into ‘rails new’ manually. By putting your preferred options/flags into this file, every Rails app you create will be created consistently and just the way you like it.

I prefer postgres as my database and esbuild for my javascript processing and tailwind as my css framework. So my .railsrc file looks like this

--database=postgresql
--javascript esbuild
--css tailwind

Now I just start a new Rails app with

rails new brilliant_app_idea

And my new app is ready to rock configured just the way I prefer.