Class: Rails::Generators::ChannelGenerator
- Inherits:
-
NamedBase
- Object
- NamedBase
- Rails::Generators::ChannelGenerator
- Defined in:
- lib/rails/generators/channel/channel_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_channel_file ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rails/generators/channel/channel_generator.rb', line 14 def create_channel_file template "channel.rb", File.join("app/channels", class_path, "#{file_name}_channel.rb") if [:assets] if behavior == :invoke template "assets/cable.js", "app/assets/javascripts/cable.js" end js_template "assets/channel", File.join("app/assets/javascripts/channels", class_path, "#{file_name}") end generate_application_cable_files end |