Class: NgSectionGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Utilities
Defined in:
lib/generators/ng_section/ng_section_generator.rb

Instance Method Summary collapse

Methods included from Utilities

#formatted_name, #uncapitalize_first_char

Instance Method Details

#create_controllersObject



13
14
15
16
17
18
19
20
# File 'lib/generators/ng_section/ng_section_generator.rb', line 13

def create_controllers
  args.each do | arg |
    file_name = formatted_name(arg, false)
    self.send(:controller_name=, formatted_name(arg, true, false))
    template "controller.js.erb", root_directory_with("#{file_name}_controller.js")
  end

end

#create_moduleObject



9
10
11
# File 'lib/generators/ng_section/ng_section_generator.rb', line 9

def create_module
  template "module.js.erb", root_directory_with("module.js")
end