Class: Puffer::ComponentGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Puffer::ComponentGenerator
- Defined in:
- lib/generators/puffer/component/component_generator.rb
Instance Method Summary collapse
Instance Method Details
#generate_component ⇒ Object
4 5 6 7 8 |
# File 'lib/generators/puffer/component/component_generator.rb', line 4 def generate_component @name = name.underscore template 'component.rb', "app/components/#{@name}_component.rb" end |
#generate_views ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/generators/puffer/component/component_generator.rb', line 10 def generate_views @name = name.underscore create_file "app/components/#{@name}/index.html.erb", "# I'm index" create_file "app/components/#{@name}/form.html.erb", "# I'm form" create_file "app/components/#{@name}/filter.html.erb", "# I'm filter" end |