blob: 073eec954008a9f2c1a580e2bdca4ddb18c33f4f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
class Api::V1::GamesController < ApplicationController
skip_before_action :verify_authenticity_token
def create
puts request.methods.sort
@game = Game.new(games_params)
if @game.save
render json: @game, status: :created
else
render json: @game.errors, status: :unprocessable_entity
end
end
private
def games_params
params.require(:game).permit(:title, :game_file)
end
end
|