Sha256: a5b4ad304d07513551a83f2a31949c85fac0e2dc4ae7bf24dd36953cf8ef995c

Contents?: true

Size: 785 Bytes

Versions: 24

Compression:

Stored size: 785 Bytes

Contents

app.<%= class_name.camelize(:lower) %>Channel = app.cable.subscriptions.create "<%= class_name %>Channel",
  connected: ->
    # Called when the subscription is ready for use on the server
    if app.currentPage
      currentPage.trigger 'channel-connected', ['<%= class_name.underscore %>']

  disconnected: ->
    # Called when the subscription has been terminated by the server
    if app.currentPage
      currentPage.trigger 'channel-disconnected', ['<%= class_name.underscore %>']

  received: (data) ->
    # Called when there's incoming data on the websocket for this channel
    if app.currentPage
      currentPage.trigger 'channel-received', ['<%= class_name.underscore %>', data]
<% actions.each do |action| -%>

  <%= action %>: ->
    @perform '<%= action %>'
<% end -%>

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
tao_on_rails-0.10.0 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.9.3 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.9.2 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.9.1 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.9.0 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.8.2 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.8.1 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.8.0 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.7.3 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.7.2 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.7.1 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.7.0 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.6.13 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.6.12 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.6.11 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.6.10 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.6.9 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.6.8 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.6.7 lib/generators/tao/channel/templates/channel.coffee.erb
tao_on_rails-0.6.6 lib/generators/tao/channel/templates/channel.coffee.erb