Module: OurKudos::Api::Controllers::ClientBase

Includes:
ApiHelper
Defined in:
lib/ourkudos/controllers/client_base.rb

Instance Method Summary collapse

Methods included from ApiHelper

#api_columns, #current_model, #model_as_symbol, #model_instance

Instance Method Details

#createObject



8
9
10
# File 'lib/ourkudos/controllers/client_base.rb', line 8

def create
  current_user.ourkudos.post("/api/#{controller_name}.json", params[model_as_symbol])
end

#updateObject



12
13
14
# File 'lib/ourkudos/controllers/client_base.rb', line 12

def update
  current_user.ourkudos.post("/api/#{controller_name}/#{mode_instance.id.to_s}.json", params[model_as_symbol])
end