Skip to content

Instantly share code, notes, and snippets.

@mtmcfarl
Last active August 29, 2015 13:56
Show Gist options
  • Save mtmcfarl/9136474 to your computer and use it in GitHub Desktop.
Save mtmcfarl/9136474 to your computer and use it in GitHub Desktop.
Example of a web hook
module Hookable
extend ActiveSupport::Concern
def perform_post
end
end
class Comment < ActiveRecord::Base
include Hookable
belongs_to :user
def after_save
perform_post(self.user.callback_url,
:payload => self.to_json)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment