1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

13 commits

Author SHA1 Message Date
Prathamesh Sonpatki
d0023deb74
Generate cable.js file if does not exist when generating channel
- Before this, while generating a channel, we were not creating
  `cable.js` if it does not already exist.
- We have similar code for application mailer here -
  0b3ae023d2.
- Based on the comment -
  https://github.com/rails/rails/issues/24418#issuecomment-205421995.
2016-04-12 22:49:38 +05:30
Jon Moss
83921b8f87 Generate ApplicationCable files if they do not already exist 2016-02-22 20:46:06 -05:00
yuuji.yaginuma
cdb6f2eb9e don’t explicitly mention EventMachine [ci skip]
Follow up to 6accef4e11
2016-02-05 21:52:59 +09:00
yuuji.yaginuma
4a7bd88eaf add line break between method of generated channel js
```
# before
App.appearance = App.cable.subscriptions.create "AppearanceChannel",
  connected: ->
    # Called when the subscription is ready for use on the server

  disconnected: ->
    # Called when the subscription has been terminated by the server

  received: (data) ->
    # Called when there's incoming data on the websocket for this channel

  appear: ->
    @perform 'appear'
  away: ->
    @perform 'away'
```

```
# after
App.appearance = App.cable.subscriptions.create "AppearanceChannel",
  connected: ->
    # Called when the subscription is ready for use on the server

  disconnected: ->
    # Called when the subscription has been terminated by the server

  received: (data) ->
    # Called when there's incoming data on the websocket for this channel

  appear: ->
    @perform 'appear'

  away: ->
    @perform 'away'
```
2015-12-18 20:19:04 +09:00
David Heinemeier Hansson
e16d7c6808 Should also stub the received callback 2015-12-17 21:53:05 +01:00
David Heinemeier Hansson
28035db109 Generate all the ApplicationCable stubs by default, like all other Application* stubs 2015-12-16 21:05:13 +01:00
David Heinemeier Hansson
bf16ec25b3 Comment out the user handling so default setup connects directly 2015-12-16 20:36:11 +01:00
David Heinemeier Hansson
0036cb35b8 Require tree 2015-12-16 18:58:50 +01:00
David Heinemeier Hansson
0625d77784 Note that changes to the cable setup requires restarting the server 2015-12-16 18:23:11 +01:00
David Heinemeier Hansson
8e9b7c0405 @App could have been set elsewhere 2015-12-16 18:17:12 +01:00
David Heinemeier Hansson
aae14ab3ac Fix parent class 2015-12-16 18:17:12 +01:00
David Heinemeier Hansson
26bcf81a01 Move Cable to ActionCable for client-side constant to avoid conflicts 2015-12-16 15:29:21 +01:00
David Heinemeier Hansson
40cc72548f Basic channel generator 2015-12-15 21:39:22 +01:00