Class: Wallaby::JsonApiResponder
- Inherits:
-
ResourcesResponder
- Object
- ActionController::Responder
- ResourcesResponder
- Wallaby::JsonApiResponder
- Defined in:
- lib/responders/wallaby/json_api_responder.rb
Overview
Easter egg: simple responder for JSON API
Instance Method Summary collapse
Methods inherited from ResourcesResponder
Instance Method Details
#to_html ⇒ Object
9 10 11 |
# File 'lib/responders/wallaby/json_api_responder.rb', line 9 def to_html to_json end |
#to_json ⇒ String
Returns JSON.
14 15 16 17 18 19 20 21 |
# File 'lib/responders/wallaby/json_api_responder.rb', line 14 def to_json(*) = { content_type: 'application/vnd.api+json', status: [:status] } if exception? render .merge(json: exception_details) else render .merge() end end |