rename original gangsta to gang
This commit is contained in:
28
app/controllers/gangs_controller.rb
Normal file
28
app/controllers/gangs_controller.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
class GangsController < ApplicationController
|
||||
def show
|
||||
if Gang.count.zero?
|
||||
Gang.create.save
|
||||
end
|
||||
|
||||
json_response Gang.first
|
||||
end
|
||||
|
||||
def update
|
||||
if gang_params[:chip_scale].to_i.positive?
|
||||
Gang.update(gang_params)
|
||||
json_response onboarded: true
|
||||
else
|
||||
error_response :bad_request
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def gang_params
|
||||
params.require(:gang).permit :chip_name,
|
||||
:chip_code,
|
||||
:chip_symbol,
|
||||
:chip_scale,
|
||||
:chip_prefixed
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user