diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-03-01 15:19:52 -0300 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2016-03-01 15:19:52 -0300 |
commit | 998d21a961b68eb37f5d20c9e96fa5b6a14131b0 (patch) | |
tree | 7dabd36220c4d34958adab8dabe6111c819eff2f /railties/lib | |
parent | 56f3bbc5b0920e44fcac83ed2d38eb90b3744183 (diff) | |
parent | 861e7d43e320dec770d353b9aeba625ff7573fda (diff) | |
download | rails-998d21a961b68eb37f5d20c9e96fa5b6a14131b0.tar.gz rails-998d21a961b68eb37f5d20c9e96fa5b6a14131b0.tar.bz2 rails-998d21a961b68eb37f5d20c9e96fa5b6a14131b0.zip |
Merge pull request #23935 from y-yagi/convert_cable_coffee_to_javascript
convert cable.coffee to cable.js
Diffstat (limited to 'railties/lib')
3 files changed, 14 insertions, 10 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 562193bc3a..f4d2aa761b 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -333,7 +333,7 @@ module Rails def delete_action_cable_files_skipping_action_cable if options[:skip_action_cable] remove_file 'config/cable.yml' - remove_file 'app/assets/javascripts/cable.coffee' + remove_file 'app/assets/javascripts/cable.js' remove_dir 'app/channels' end end diff --git a/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee b/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee deleted file mode 100644 index af08f58e34..0000000000 --- a/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.coffee +++ /dev/null @@ -1,9 +0,0 @@ -# Action Cable provides the framework to deal with WebSockets in Rails. -# You can generate new channels where WebSocket features live using the rails generate channel command. -# -#= require action_cable -#= require_self -#= require_tree ./channels - -@App ||= {} -App.cable = ActionCable.createConsumer() diff --git a/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.js b/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.js new file mode 100644 index 0000000000..71ee1e66de --- /dev/null +++ b/railties/lib/rails/generators/rails/app/templates/app/assets/javascripts/cable.js @@ -0,0 +1,13 @@ +// Action Cable provides the framework to deal with WebSockets in Rails. +// You can generate new channels where WebSocket features live using the rails generate channel command. +// +//= require action_cable +//= require_self +//= require_tree ./channels + +(function() { + this.App || (this.App = {}); + + App.cable = ActionCable.createConsumer(); + +}).call(this); |