Class: Ember::ControllerGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Ember::ControllerGenerator
show all
- Includes:
- GeneratorHelpers
- Defined in:
- lib/generators/ember/controller/controller_generator.rb
Instance Method Summary
collapse
#application_name, #ember_path, #spec_path
Instance Method Details
#generate_controller ⇒ Object
12
13
14
|
# File 'lib/generators/ember/controller/controller_generator.rb', line 12
def generate_controller
template 'controller.js.coffee', "#{ember_path}/controllers/#{controller_name}_controller.js.coffee"
end
|
#generate_directory ⇒ Object
8
9
10
|
# File 'lib/generators/ember/controller/controller_generator.rb', line 8
def generate_directory
empty_directory "#{ember_path}/controllers"
end
|
#generate_specs ⇒ Object
22
23
24
|
# File 'lib/generators/ember/controller/controller_generator.rb', line 22
def generate_specs
template 'controller_spec.js.coffee', "#{spec_path}/controllers/#{controller_name}_controller_spec.js.coffee"
end
|
#generate_views ⇒ Object
16
17
18
19
20
|
# File 'lib/generators/ember/controller/controller_generator.rb', line 16
def generate_views
routes.each do |route|
generate 'ember:view', controller_name, route
end
end
|