1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Move the error raising to api_behavior.

This commit is contained in:
José Valim 2010-04-07 16:18:13 +02:00
parent ec73710c79
commit 149d13e1f0

View file

@ -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?