rails new ecommerce --api -d postgresql -T
Rails.application.routes.draw do constraints subdomain: 'api' do end end
rails g model Book title:string author:string weight:string publisher:string language:string pages:integer publication_date:datetime
rake db:create
rake db:migrate
gem 'versionist' in GEMLFILE RUN rails generate versionist:new_api_version v1 V1 --path=value:v1
api_version(:module => "V1", :path => {:value => "v1"}) do end
resources :books
path: app/controllers/v1/books_controller.rb
RUN Book.create(title: "Atlas Shrugged", author: "Ayn Rand", weight: "3.4 pounds", publisher: "Dutton", language: "English", pages: 1168, publication_date: "April 21, 2005")
GET http://api.localhost:3000/v1/books
mentioned in app/controllers/v1/books_controller.rb