Aug 22, 2024
rails new video --api
routes.rb
, gemfile
, controllers
, initializers
.rack-cors
gem in Gemfile
, then run bundle install
.config/initializers/cors.rb
, un-comment and configure origins.
127.0.0.1:5173
) during development.rails g scaffold Post title:string body:text
faker
gem for test data generation.db/seeds.rb
using Faker:
Post.destroy_all
20.times do
Post.create(title: Faker::Lorem.sentence(word_count: 3), body: Faker::Lorem.paragraph(sentence_count: 3))
end
rails db:migrate
rails db:seed
Post.order(created_at: :desc)
rails-controller-testing
gem to support certain test methods.git add .
git commit -m 'Initial commit'