diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-04-16 15:19:41 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-04-16 15:19:41 +0900 |
commit | aa757d0c1151f83104da241f30b1924d748a5d78 (patch) | |
tree | 40c4c78e9095bf2c3bfa842f36196ff9f8dbdcb2 /actioncable/lib/rails/generators/channel | |
parent | 39e087cbf5628ecc351fc86a3a1e320be193bf29 (diff) | |
download | rails-aa757d0c1151f83104da241f30b1924d748a5d78.tar.gz rails-aa757d0c1151f83104da241f30b1924d748a5d78.tar.bz2 rails-aa757d0c1151f83104da241f30b1924d748a5d78.zip |
don't remove `cable.js`
`cable.js` is required for other Channels.
Diffstat (limited to 'actioncable/lib/rails/generators/channel')
-rw-r--r-- | actioncable/lib/rails/generators/channel/channel_generator.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actioncable/lib/rails/generators/channel/channel_generator.rb b/actioncable/lib/rails/generators/channel/channel_generator.rb index 3bcf5f1898..05fd21a954 100644 --- a/actioncable/lib/rails/generators/channel/channel_generator.rb +++ b/actioncable/lib/rails/generators/channel/channel_generator.rb @@ -13,7 +13,9 @@ module Rails template "channel.rb", File.join('app/channels', class_path, "#{file_name}_channel.rb") if options[:assets] - template "assets/cable.js", "app/assets/javascripts/cable.js" + if self.behavior == :invoke + template "assets/cable.js", "app/assets/javascripts/cable.js" + end template "assets/channel.coffee", File.join('app/assets/javascripts/channels', class_path, "#{file_name}.coffee") end |