-
-
Save DavidColby/49a99e51c8f31217254438e30012dd56 to your computer and use it in GitHub Desktop.
Generator for custom Stimulus generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StimulusGenerator < Rails::Generators::NamedBase | |
source_root File.expand_path('templates', __dir__) | |
def create_controller | |
template('controller.js', File.join("app/javascript/controllers/#{file_name}_controller.js")) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment