Class: Intermodal::LinkingResourceResponder
- Inherits:
-
ResourceResponder
- Object
- ActionController::Responder
- ResourceResponder
- Intermodal::LinkingResourceResponder
- Defined in:
- lib/intermodal/responders/linking_resource_responder.rb
Instance Attribute Summary
Attributes inherited from ResourceResponder
Instance Method Summary collapse
-
#respond ⇒ Object
This is the common behavior for “API” requests, like :xml and :json.
Methods inherited from ResourceResponder
Constructor Details
This class inherits a constructor from Intermodal::ResourceResponder
Instance Method Details
#respond ⇒ Object
This is the common behavior for “API” requests, like :xml and :json.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/intermodal/responders/linking_resource_responder.rb', line 7 def respond if get? display resource, :root => presentation_root elsif has_errors? display resource.errors, :status => :unprocessable_entity elsif post? display resource, :status => :created #:location => api_location # Taken out because it requires some additional URL definitions else head :ok end end |