Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generator for custom Stimulus generator
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