Skip to content

Instantly share code, notes, and snippets.

@swilgosz
Created June 3, 2019 17:43
Show Gist options
  • Save swilgosz/85340deaef37bc4a6c6183d3898ef463 to your computer and use it in GitHub Desktop.
Save swilgosz/85340deaef37bc4a6c6183d3898ef463 to your computer and use it in GitHub Desktop.
How standard create action could look like using the fast_jsonapi gem.
def create
user = User.create!(params.require(:data).require(:attributes))
render json: UserSerializer.new(user), status: 201
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment