sajad torkamani

Update Rails to latest version

gem update rails 

Create project

With specific database

rails new myapp  --database=<postgresql|mysql>

With specific database and CSS strategy

rails new myapp --database=postgresql --css=tailwind

As an API-only backend

rails new <name> --api --database=postgresql -T

As a very minimal API-only backend:

Example project on GitHub.

rails new <name> --api -T
  • -T: skip tests

My current choice

rails new <name> --database=mysql --skip-test --c=tailwind

As a GraphQL back-end

rails new oolala-backend --database=mysql -T -J --skip-hotwire

Configure database

Edit config/database.yml and set the correct database credentials.

Create database:

./bin/rails db:create

Setup project

Tagged: Rails