Created
June 23, 2015 08:17
-
-
Save ozgun/a326ecba54e804abc0d2 to your computer and use it in GitHub Desktop.
Custom Responder
This file contains hidden or 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
module MyModule | |
class CustomResponder < ActionController::Responder | |
include Responders::FlashResponder | |
include Responders::HttpCacheResponder | |
def has_errors? | |
case controller.action_name | |
when 'destroy' | |
resource.destroyed? ? false : true | |
else | |
super | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment