-
-
Save yoppi/468485df9eeb4a680bb7 to your computer and use it in GitHub Desktop.
after_actionするやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AController < ApplicationController | |
after_action :f, if: -> { response.status == 200 } | |
def f | |
end | |
def x | |
head 200 # call f | |
# head 404 # not call f | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment