rails new react-js-amazon-app --webpack=react -d=postgresql
or if api only
rails new products_api --api -d=postgresql
rails db:create
scaffold:
rails g scaffold product name:string category:text dimensions:string rank:string asin:string
rails g controller products index show create
rails g model product name category dimensions
rails db:migrate
go to db/seed.rb
10.times do |number|
Product.create(name: "product #{number}", dimensions: "#{number}", category: "#{number}", rank: "#{number}", asin: "asin-#{number}" )
end
root "products#index"
resources :products, only: [:index, :show, :create]
<%= javascript_pack_tag 'hello_react' %>
yarn add bootstrap