Created
June 3, 2019 17:43
-
-
Save swilgosz/85340deaef37bc4a6c6183d3898ef463 to your computer and use it in GitHub Desktop.
How standard create action could look like using the fast_jsonapi gem.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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