Class: Rails::Generators::ChannelGenerator

Inherits:
NamedBase show all
Defined in:
actioncable/lib/rails/generators/channel/channel_generator.rb

Instance Method Summary collapse

Methods inherited from NamedBase

#initialize

Methods inherited from Base

base_root, class_option, default_source_root, desc, exit_on_failure?, hide!, hook_for, inherited, namespace, remove_hook_for, source_root

Methods included from Actions

#add_source, #environment, #gem, #gem_group, #generate, #git, #github, #initialize, #initializer, #lib, #rails_command, #rake, #rakefile, #readme, #route, #vendor

Constructor Details

This class inherits a constructor from Rails::Generators::NamedBase

Instance Method Details

#create_channel_filesObject


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'actioncable/lib/rails/generators/channel/channel_generator.rb', line 16

def create_channel_files
  create_shared_channel_files
  create_channel_file

  if using_javascript?
    if first_setup_required?
      create_shared_channel_javascript_files
      import_channels_in_javascript_entrypoint

      if using_importmap?
        pin_javascript_dependencies
      elsif using_node?
        install_javascript_dependencies
      end
    end

    create_channel_javascript_file
    import_channel_in_javascript_entrypoint
  end
end