Reputation: 781
I have an after_filter in one of my controllers that I want to execute only if the response status code is 200. Otherwise I want to skip it. Is that possible?
Upvotes: 2
Views: 749
Reputation: 15089
A quick and easy way is to put a conditional on your after_filter
like this:
after_filter :do_something
def do_something
if response.code == '200'
# do something
end
end
Upvotes: 6