Class: Api::ApiResponder

Inherits:
ActionController::Responder
  • Object
show all
Defined in:
lib/api/api_responder.rb

Instance Method Summary collapse

Instance Method Details

#api_behavior(error) ⇒ Object

overview api_behavior


5
6
7
8
9
10
11
12
13
14
15
# File 'lib/api/api_responder.rb', line 5

def api_behavior(error)
  raise error unless resourceful?

  if !get? && !post?
    #return resource instead of default "head :no_content" for PUT, PATCH, and DELETE
    display resource
  else
    super
  end

end