Exception: RESTFramework::Errors::NilPassedToRenderAPIError

Inherits:
BaseError
  • Object
show all
Defined in:
lib/rest_framework/errors/nil_passed_to_render_api_error.rb

Instance Method Summary collapse

Instance Method Details

#messageObject



2
3
4
5
6
7
8
9
10
# File 'lib/rest_framework/errors/nil_passed_to_render_api_error.rb', line 2

def message
  "    Payload of `nil` was passed to `render_api`; this is unsupported. If you want a blank\n    response, pass `''` (an empty string) as the payload. If this was the result of a `find_by`\n    (or similar Active Record method) not finding a record, you should use the bang version (e.g.,\n    `find_by!`) to raise `ActiveRecord::RecordNotFound`, which the REST controller will catch and\n    return an appropriate error response.\n  MSG\nend\n".split("\n").join(" ")