Module: InboxesHelper

Defined in:
app/helpers/inboxes_helper.rb

Instance Method Summary collapse

Instance Method Details

#inboxes_faye_broadcast(channel, &block) ⇒ Object



3
4
5
6
7
# File 'app/helpers/inboxes_helper.rb', line 3

def inboxes_faye_broadcast(channel, &block)
  message = {:channel => channel, :data => capture(&block), :ext => {:auth_token => defined?(FAYE_TOKEN) ? FAYE_TOKEN : ""}}
  uri = URI.parse("http://#{Inboxes::config.faye_host}:#{Inboxes::config.faye_port}/faye")
  resource = Net::HTTP.post_form(uri, :message => message.to_json)
end