I'm trying to figure out how to use this jsonapi-resources gem but I'm finding it quite difficult.
Let's say I just submitted an object like:
class CategoriesController < ApplicationController
class Category < ActiveRecord::Base
class CategoryResource < JSONAPI::Resource
attribute :name #,:slug
Try the following:
class CategoryResource < JSONAPI::Resource attribute :name #,:slug has_many :posts before_save do # add logic to change or add attributes to model on create/edit # for example @model.slug = # logic to assign the slug @model.series = # logic to assign the series end end