diff options
author | Jeffrey Hardy <packagethief@gmail.com> | 2015-07-08 23:22:56 -0400 |
---|---|---|
committer | Jeffrey Hardy <packagethief@gmail.com> | 2015-07-08 23:22:56 -0400 |
commit | 502d47d7f6b5bf9533676c44b9e325dc3feca3c0 (patch) | |
tree | 1628db3ad2b69e4524bcf54981719f00b3eb3a87 /README.md | |
parent | 5ad75fb4596416d36b513373c3745d10c3acee15 (diff) | |
download | rails-502d47d7f6b5bf9533676c44b9e325dc3feca3c0.tar.gz rails-502d47d7f6b5bf9533676c44b9e325dc3feca3c0.tar.bz2 rails-502d47d7f6b5bf9533676c44b9e325dc3feca3c0.zip |
Fix CoffeeScript syntax in code examples
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -173,12 +173,12 @@ class WebNotificationsChannel < ApplicationCable::Channel ```coffeescript # Somewhere in your app this is called, perhaps from a NewCommentJob ActionCable.server.broadcast \ - "web_notifications_1", { title: 'New things!', body: 'All shit fit for print' } + "web_notifications_1", { title: 'New things!', body: 'All shit fit for print' } # 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'] + received: (data) -> + 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`. |