diff --git a/lib/private_pub/view_helpers.rb b/lib/private_pub/view_helpers.rb index 9048f36..294f538 100644 --- a/lib/private_pub/view_helpers.rb +++ b/lib/private_pub/view_helpers.rb @@ -18,5 +18,14 @@ def subscribe_to(channel) raw("PrivatePub.sign(#{subscription.to_json});") end end + + # Subscribe the client to the given channel W/o generate + # tag. This generates some JavaScript calling + # PrivatePub.sign with the subscription options. + def tiny_subscribe_to(channel) + subscription = PrivatePub.subscription(:channel => channel) + raw("PrivatePub.sign(#{subscription.to_json});") + end + end end