Created
January 20, 2020 15:30
-
-
Save speratus/856ebdeb3ad5c710620a92a68eb9118d to your computer and use it in GitHub Desktop.
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.new(name: params[:name]) | |
user.avatar.attach(params[:avatar]) | |
if user.save | |
puts "The user saved successfully" | |
render json: user | |
else | |
puts "The user failed to save" | |
render json: {message: "Error"} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment