From 9766997f4ce26fe0d97d7b9eebf885ddb517c80c Mon Sep 17 00:00:00 2001 From: Josh Kalderimis Date: Wed, 30 Mar 2011 20:53:42 +0200 Subject: when using respond_with with an invalid resource and custom options, the default response status and error messages should be returned MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- actionpack/lib/action_controller/metal/responder.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/metal/responder.rb b/actionpack/lib/action_controller/metal/responder.rb index 4b45413cf8..82d11c8481 100644 --- a/actionpack/lib/action_controller/metal/responder.rb +++ b/actionpack/lib/action_controller/metal/responder.rb @@ -156,7 +156,8 @@ module ActionController #:nodoc: if get? display resource elsif has_errors? - display resource.errors, :status => :unprocessable_entity + # bypass the options merging of display + controller.render format => resource.errors, :status => :unprocessable_entity elsif post? display resource, :status => :created, :location => api_location elsif has_empty_resource_definition? -- cgit v1.2.3