Class: Para::Page::SectionGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Para::Page::SectionGenerator
show all
- Includes:
- Generators::NameHelpers
- Defined in:
- lib/generators/para/page/section/section_generator.rb
Instance Method Summary
collapse
#namespaced_class_name, #plural_namespaced_path, #singular_namespaced_path
Instance Method Details
#generate_fields ⇒ Object
17
18
19
|
# File 'lib/generators/para/page/section/section_generator.rb', line 17
def generate_fields
generate 'para:nested_fields', "page_section/#{ singular_namespaced_path }"
end
|
#generate_model ⇒ Object
10
11
12
13
14
15
|
# File 'lib/generators/para/page/section/section_generator.rb', line 10
def generate_model
template(
"section.rb.erb",
"app/models/page_section/#{ singular_namespaced_path }.rb"
)
end
|
#generate_template ⇒ Object
21
22
23
24
25
26
|
# File 'lib/generators/para/page/section/section_generator.rb', line 21
def generate_template
template(
"section.html.haml.erb",
"app/views/page_section/#{ plural_namespaced_path }/_#{ singular_namespaced_path }.html.haml"
)
end
|