class Para::Page::SectionGenerator
Public Instance Methods
Source
# File lib/generators/para/page/section/section_generator.rb, line 17 def generate_fields generate 'para:nested_fields', "page_section/#{ singular_namespaced_path }" end
Source
# 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
Source
# 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
Private Instance Methods
Source
# File lib/generators/para/page/section/section_generator.rb, line 30 def attributes_separated_with_commas if attributes.empty? ':title' else attributes.map { |attribute| ":#{ attribute.name }" }.join(', ') end end