This is how I start Rails applications. I avoid straying too far from default/upcoming Rails configurations.
Creating a new Rails application
rails new <name> --database=postgresql --asset-pipeline=propshaft --css=tailwind
Why PostgreSQL?
It’s what I know best and has features that I miss when I last used MySQL. I’m also interested in using SQLite in production but I haven’t explored that enough.
Why Propshaft?
The days of Webpack/Webpacker are behind us and I appreciate the simplicity of Propshaft over Sprockets. I also prefer to keep frontend dependencies to a minimum and hope to eventually approach “no-build”.
Why Tailwind CSS?
I know just enough CSS to be dangerous and I’m more productive with Tailwind CSS than without. There are downsides, however, and I would like to eventually need only vanilla CSS.
Setting up a new Rails application
Rubocop Rails Omakase
https://github.com/rails/rubocop-rails-omakase
# Gemfile
gem "rubocop-rails-omakase", require: false, group: [ :development ]
> bundle
> bundle binstubs rubocop
# .rubocop.yml
inherit_gem:
rubocop-rails-omakase: rubocop.yml
> bin/rubocop -a
Disable Rails helper generators
In config/application.rb
:
module YourApp
class Application < Rails::Application
config.generators do |g|
g.helper false
end
end
end