Class: ArkUpdateController

Inherits:
ApplicationController show all
Defined in:
frontend/app/controllers/ark_update_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#archivesspace, can_access?, permission_mappings, set_access_control

Instance Method Details

#updateObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'frontend/app/controllers/ark_update_controller.rb', line 5

def update
  uri = "#{JSONModel::HTTP.backend_url}#{params[:uri]}/ark_name"

  response = JSONModel::HTTP::post_json(URI(uri), params[:ark_name])

  if response.code == '200'
    render :plain => "OK"
  else
    err = ASUtils.json_parse(response.body)
    render :plain => ASUtils.to_json(err.fetch('error')), :status => response.code
  end
end