Class: Goldencobra::Api::V2::SettingsController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/goldencobra/api/v2/settings_controller.rb

Instance Method Summary collapse

Instance Method Details

#get_stringObject

/api/v2/setting_string




12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/goldencobra/api/v2/settings_controller.rb', line 12

def get_string
  # check if we have the argument
  unless params[:setting_key]
    render status: 200, text: ""
    return
  end

  # check if the setting_key contains something
  if params[:setting_key].length == 0
    render status: 200, text: ""
  else
    # get the translation for setting_key and return the locale value
    render status: 200, text: s(params[:setting_key])
  end
end