add homie to the gang when homie is created

This commit is contained in:
Bilal
2020-10-07 22:47:19 +03:00
parent 8d7716f2e0
commit 8832ba071b
9 changed files with 43 additions and 5 deletions

View File

@@ -1,4 +1,10 @@
class GangsController < ApplicationController
def index
json_response Gang.all
rescue StandardError
error_response :bad_request
end
def show
if Gang.count.zero?
Gang.create.save
@@ -19,7 +25,8 @@ class GangsController < ApplicationController
private
def gang_params
params.require(:gang).permit :chip_name,
params.require(:gang).permit :name,
:chip_name,
:chip_code,
:chip_symbol,
:chip_scale,