Class: Noodall::ComponentGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/noodall/component/component_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_node_filesObject



12
13
14
15
16
17
# File 'lib/generators/noodall/component/component_generator.rb', line 12

def create_node_files
  template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
  template "template.html.erb", "app/views/components/_#{file_name}.html.erb"
  template "admin_template.html.erb", "app/views/admin/components/_#{file_name}.html.erb"
  template "factory.rb", "spec/factories/#{file_name}.rb" if options.factory?
end