diff options
Diffstat (limited to 'actioncable/lib/rails/generators')
-rw-r--r-- | actioncable/lib/rails/generators/channel/channel_generator.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actioncable/lib/rails/generators/channel/channel_generator.rb b/actioncable/lib/rails/generators/channel/channel_generator.rb index 2f37d8055b..c5d398810a 100644 --- a/actioncable/lib/rails/generators/channel/channel_generator.rb +++ b/actioncable/lib/rails/generators/channel/channel_generator.rb @@ -5,11 +5,16 @@ module Rails argument :actions, type: :array, default: [], banner: "method method" + class_option :assets, type: :boolean + check_class_collision suffix: "Channel" def create_channel_file template "channel.rb", File.join('app/channels', class_path, "#{file_name}_channel.rb") - template "assets/channel.coffee", File.join('app/assets/javascripts/channels', class_path, "#{file_name}.coffee") + + if options[:assets] + template "assets/channel.coffee", File.join('app/assets/javascripts/channels', class_path, "#{file_name}.coffee") + end end protected |