Last active
December 28, 2015 20:59
-
-
Save kostia/7561398 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Customer | |
class BaseController < ApplicationController | |
# ... | |
before_filter :enable_live_notifications, only: [:waiter_home, :cook_home] | |
# ... | |
private | |
def enable_live_notifications | |
@live_notifications_channel = @venue.live_notifications_channel | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%# ... %> | |
<span data-live-notifications-channel="<%= @live_notifications_channel %>"></span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ -> | |
config = $('[data-live-notifications-channel']) | |
if config | |
channel = config.attr 'data-live-notifications-channel' | |
if channel | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment