提交 149d13e1 编写于 作者: J José Valim

Move the error raising to api_behavior.

上级 ec73710c
......@@ -135,7 +135,6 @@ def to_html
def to_format
default_render
rescue ActionView::MissingTemplate => e
raise unless resourceful?
api_behavior(e)
end
......@@ -154,6 +153,8 @@ def navigation_behavior(error)
# 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?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册