rails new my-api --api --no-sprockets -d mysql
docker compose up -d
Start (Recommand read a Trobleshooting)
rails db:drop db:create db:migrate
rails s
-
Ruby version: 2.7.1
-
Rails version : 6.0.3.4
bundle add 'prettier'
bundle exec rbprettier --write '**/*.rb'
https://github.com/ctran/annotate_models
rails g annotate:install
rake annotate_models # Add schema information (as comments) to model and fixture files
rake annotate_routes # Adds the route map to routes.rb
rake remove_annotation # Remove schema information from model and fixture files
https://guides.rubyonrails.org/command_line.html
# test.rb
require 'pry'
class A
def hello() puts "hello world!" end
end
a = A.new
# start a REPL session
binding.pry
# program resumes here (after pry session)
puts "program resumes here."