aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/rails/generators/channel/channel_generator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actioncable/lib/rails/generators/channel/channel_generator.rb')
-rw-r--r--actioncable/lib/rails/generators/channel/channel_generator.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actioncable/lib/rails/generators/channel/channel_generator.rb b/actioncable/lib/rails/generators/channel/channel_generator.rb
index 925dd3d098..c5d398810a 100644
--- a/actioncable/lib/rails/generators/channel/channel_generator.rb
+++ b/actioncable/lib/rails/generators/channel/channel_generator.rb
@@ -5,11 +5,14 @@ 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")
- if Rails::Generators.options[:rails][:assets]
+
+ if options[:assets]
template "assets/channel.coffee", File.join('app/assets/javascripts/channels', class_path, "#{file_name}.coffee")
end
end