Skip to content

Instantly share code, notes, and snippets.

@ozgun
Created June 23, 2015 08:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozgun/a326ecba54e804abc0d2 to your computer and use it in GitHub Desktop.
Save ozgun/a326ecba54e804abc0d2 to your computer and use it in GitHub Desktop.
Custom Responder
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