提交 502d47d7 编写于 作者: J Jeffrey Hardy

Fix CoffeeScript syntax in code examples

上级 5ad75fb4
......@@ -178,7 +178,7 @@ ActionCable.server.broadcast \
# Client-side which assumes you've already requested the right to send web notifications
App.cable.subscriptions.create "WebNotificationsChannel",
received: (data) ->
web_notification = new Notification data['title'], body: data['body']
new Notification data['title'], body: data['body']
```
The `ActionCable.server.broadcast` call places a message in the Redis' pubsub queue under the broadcasting name of `web_notifications_1`.
......
......@@ -16,7 +16,7 @@ module Server
# # Client-side coffescript which assumes you've already requested the right to send web notifications
# App.cable.subscriptions.create "WebNotificationsChannel",
# received: (data) ->
# web_notification = new Notification data['title'], body: data['body']
# new Notification data['title'], body: data['body']
module Broadcasting
# Broadcast a hash directly to a named <tt>broadcasting</tt>. It'll automatically be JSON encoded.
def broadcast(broadcasting, message)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册