Module: Puller::ViewHelpers
- Defined in:
- lib/puller/view_helpers.rb
Instance Method Summary collapse
Instance Method Details
#publish_to(channel_event, data = nil, &block) ⇒ Object
3 4 5 |
# File 'lib/puller/view_helpers.rb', line 3 def publish_to(channel_event, data = nil, &block) Puller.publish_to channel_event, data || capture(&block) end |
#subscribe_to(channel_event) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/puller/view_helpers.rb', line 7 def subscribe_to(channel_event) channel, event = Puller.channel_and_event_for(channel_event) = { :channel => channel, :event => event, :apiKey => Pusher.key } content_tag "script", :type => "text/javascript" do raw "Puller.sign(#{.to_json});" end end |