Created
November 27, 2019 06:10
-
-
Save camiloforero/5c61a3fa2c0a964c577ac729f293da18 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# app/controllers/things_controller.rb | |
class ItemsController < ApplicationController | |
def create | |
thing = Thing.new(thing_params) | |
if thing.create | |
render json: thing, status: :created | |
else | |
render json: thing, status: :unprocessable_entity | |
end | |
end | |
private | |
def thing_params | |
params.permit(:name, :the_file) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment