Class: StimulusGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- StimulusGenerator
- Defined in:
- lib/generators/rails/stimulus/stimulus_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_controller ⇒ Object
11 12 13 |
# File 'lib/generators/rails/stimulus/stimulus_generator.rb', line 11 def create_controller template("controller.js", File.join("app/javascript/controllers/#{file_name}_controller.js")) end |
#create_controller_directory ⇒ Object
7 8 9 |
# File 'lib/generators/rails/stimulus/stimulus_generator.rb', line 7 def create_controller_directory empty_directory("app/javascript/controllers") unless File.directory?("app/javascript/controllers") end |