Class: TemplateEngineGenerator
- Inherits:
-
BaseScaffold
show all
- Defined in:
- lib/vraptor-scaffold/generators/scaffold/template_engine_generator/template_engine_generator.rb
Instance Method Summary
collapse
#base_path, #class_name, #controller_class_name, #controller_test_class_name, #controller_test_param, #imports, #initialize, #model_parameter_name, #repository_impl_name, #repository_interface_name, #repository_test_class_name, #test_class_name
Constructor Details
This class inherits a constructor from BaseScaffold
Instance Method Details
#build ⇒ Object
3
4
5
6
7
8
9
10
|
# File 'lib/vraptor-scaffold/generators/scaffold/template_engine_generator/template_engine_generator.rb', line 3
def build
define_source_paths
create_view("index")
create_view("show")
create_view("form")
create_view("edit")
create_view("new", "new#{class_name}")
end
|
#create_view(template_name, file_name = template_name) ⇒ Object
12
13
14
|
# File 'lib/vraptor-scaffold/generators/scaffold/template_engine_generator/template_engine_generator.rb', line 12
def create_view(template_name, file_name=template_name)
template("#{template_name}.erb", "#{views_path}/#{file_name}.#{extension}")
end
|
#template_path ⇒ Object
20
21
22
|
# File 'lib/vraptor-scaffold/generators/scaffold/template_engine_generator/template_engine_generator.rb', line 20
def template_path
"src/templates/views"
end
|
#views_path ⇒ Object
16
17
18
|
# File 'lib/vraptor-scaffold/generators/scaffold/template_engine_generator/template_engine_generator.rb', line 16
def views_path
File.join Configuration::WEB_INF, view_folder, model_parameter_name
end
|