Class: Rapporteur::Responder

Inherits:
ActionController::Responder
  • Object
show all
Defined in:
lib/rapporteur/responder.rb

Overview

A customization of the default Rails ActionController::Responder. Primarily, this is used to smooth out the differences between Rails responder versions and allow for error messages in GET requests.

Instance Method Summary collapse

Instance Method Details

#to_formatObject

Internal: Overrides the default behavior by ignoring the HTTP verb and always responding with errors if the rendering resource contains errors.



10
11
12
13
14
15
16
# File 'lib/rapporteur/responder.rb', line 10

def to_format
  if has_errors?
    display_errors
  else
    super
  end
end