move homies under gang
This commit is contained in:
@@ -5,12 +5,16 @@ class GangsController < ApplicationController
|
||||
error_response :bad_request
|
||||
end
|
||||
|
||||
def show
|
||||
if Gang.count.zero?
|
||||
Gang.create.save
|
||||
def create
|
||||
gang = Gang.create(gang_params)
|
||||
if gang.save
|
||||
json_response Gang.all
|
||||
else
|
||||
error_response :bad_request
|
||||
end
|
||||
|
||||
json_response Gang.first
|
||||
rescue StandardError
|
||||
error_response :bad_request
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -26,6 +30,7 @@ class GangsController < ApplicationController
|
||||
|
||||
def gang_params
|
||||
params.require(:gang).permit :name,
|
||||
:about,
|
||||
:chip_name,
|
||||
:chip_code,
|
||||
:chip_symbol,
|
||||
|
||||
Reference in New Issue
Block a user