aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorJosh Kalderimis <josh.kalderimis@gmail.com>2011-03-30 20:53:42 +0200
committerJosé Valim <jose.valim@gmail.com>2011-03-31 18:53:21 +0200
commit9766997f4ce26fe0d97d7b9eebf885ddb517c80c (patch)
treea148dca326c7b7e7e00fd71e3328332e5cbe8af7 /actionpack/lib/action_controller
parent286709336577c767498785bc7be486eefe3faa4b (diff)
downloadrails-9766997f4ce26fe0d97d7b9eebf885ddb517c80c.tar.gz
rails-9766997f4ce26fe0d97d7b9eebf885ddb517c80c.tar.bz2
rails-9766997f4ce26fe0d97d7b9eebf885ddb517c80c.zip
when using respond_with with an invalid resource and custom options, the default response status and error messages should be returned
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/metal/responder.rb3
1 files changed, 2 insertions, 1 deletions
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?