/ror-test

this is ruby on rails test for my rest api

Primary LanguageRuby

This is Rails Test for RestApi

works badge

Create options

rails new my-api --api --no-sprockets -d mysql

docker

docker compose up -d

Start (Recommand read a Trobleshooting)

rails db:drop db:create db:migrate
rails s

rails new options

  • Ruby version: 2.7.1

  • Rails version : 6.0.3.4

Prettier

bundle add 'prettier'
bundle exec rbprettier --write '**/*.rb'

Annotate (information generator for models and routes)

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

Command Line Basics

https://guides.rubyonrails.org/command_line.html

The Ruby Readline Library

https://github.com/pry/pry

# 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."