Class: UffizziCore::JsonResponder

Inherits:
ActionController::Responder
  • Object
show all
Defined in:
app/responders/uffizzi_core/json_responder.rb

Instance Method Summary collapse

Instance Method Details

#api_behavior(*args, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'app/responders/uffizzi_core/json_responder.rb', line 4

def api_behavior(*args, &block)
  if post?
    display(resource, status: :created)
  elsif put? || patch?
    display(resource, status: :ok)
  else
    super
  end
end