aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-04-07 16:18:13 +0200
committerJosé Valim <jose.valim@gmail.com>2010-04-07 16:18:13 +0200
commit149d13e1f0d157a48c04c8b3944f09ce463e9416 (patch)
treeb5eeda393051f268ce1033c692a5e28f3a7f6acd /actionpack
parentec73710c79c5e1587b489b2ce05cc34138acf071 (diff)
downloadrails-149d13e1f0d157a48c04c8b3944f09ce463e9416.tar.gz
rails-149d13e1f0d157a48c04c8b3944f09ce463e9416.tar.bz2
rails-149d13e1f0d157a48c04c8b3944f09ce463e9416.zip
Move the error raising to api_behavior.
Diffstat (limited to 'actionpack')
-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 d97c10a293..6ad9a23542 100644
--- a/actionpack/lib/action_controller/metal/responder.rb
+++ b/actionpack/lib/action_controller/metal/responder.rb
@@ -135,7 +135,6 @@ module ActionController #:nodoc:
def to_format
default_render
rescue ActionView::MissingTemplate => e
- raise unless resourceful?
api_behavior(e)
end
@@ -154,6 +153,8 @@ module ActionController #:nodoc:
# This is the common behavior for "API" requests, like :xml and :json.
def api_behavior(error)
+ raise error unless resourceful?
+
if get?
display resource
elsif has_errors?