Class: Rails::Generators::ChannelGenerator

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

Instance Method Summary collapse

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