Ideas

This is a short description of your app.

Getting Started

Requirements

  1. Ruby
  2. PostgreSQL (e.g. Postgres.app)

Setup

$ bundle install
$ rails db:setup

Development

To generate models, resources, and controllers:

$ rails generate model widget [fields]
$ rails generate jsonapi:resource widget
$ rails generate jsonapi:controller widget

Testing

$ bin/rspec

In request tests, you can use the user and access token factories to create test data to access protected resources:

user = FactoryBot.create(:user)
token = FactoryBot.create(:access_token, resource_owner_id: user.id).token
headers = {
  'Authorization' => "Bearer #{token}",
  'Content-Type' => 'application/vnd.api+json',
}

# assuming you have a Widget model that belongs to a User
FactoryBot.create(:widget, user: user)

get '/widgets', headers: headers

Running

$ rails server