Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的一个控制器中有一个 after_filter,只有在响应状态代码为 200 时我才想执行它。否则我想跳过它。那可能吗?
一种快速简便的方法是对您的after_filter喜欢设置条件:
after_filter
after_filter :do_something def do_something if response.code == '200' # do something end end