cheat sheets.

$ cheat hwh_notification
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.)
Version 1, updated 99 days ago.
. o 0 ( edit | history )
( add new | see all )