Class: Kms::SettingsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/kms/settings_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#set_csrf_cookie_for_ng

Instance Method Details

#showObject



5
6
7
# File 'app/controllers/kms/settings_controller.rb', line 5

def show
  render json: Settings.instance
end

#updateObject



9
10
11
12
13
14
15
16
# File 'app/controllers/kms/settings_controller.rb', line 9

def update
  @settings = Settings.instance
  if @settings.update(settings_params)
    render json: @settings
  else
    render json: { errors: @settings.errors.full_messages }.to_json, status: :unprocessable_entity
  end
end