To create a notification:
ActiveSupport::Notifications.instrument("products.search", :search => search)
To listen for a notification:
ActiveSupport::Notifications.subscribe "products.search" do |name, start,
finish, id, payload|
Rails.logger.debug "SEARCH: #{payload[:search]}"
end
(These can be placed inside the config/initializers directory and will
automatically be included.)cheat sheets.
$ cheat hwh_notification