Class: Quails::Generators::ChannelGenerator
- Defined in:
- actioncable/lib/rails/generators/channel/channel_generator.rb
Instance Method Summary collapse
Methods inherited from NamedBase
Methods inherited from Base
base_root, class_option, default_source_root, desc, hide!, hook_for, inherited, namespace, remove_hook_for, source_root
Methods included from Actions
#add_source, #after_bundle, #capify!, #environment, #gem, #gem_group, #generate, #git, #initialize, #initializer, #lib, #quails_command, #rake, #rakefile, #readme, #route, #vendor
Constructor Details
This class inherits a constructor from Quails::Generators::NamedBase
Instance Method Details
#create_channel_file ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'actioncable/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 |