Class: Alchemy::Generators::ElementsGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/alchemy/elements/elements_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_partialsObject


10
11
12
13
14
15
16
17
18
19
20
# File 'lib/generators/alchemy/elements/elements_generator.rb', line 10

def create_partials
  @elements = load_alchemy_yaml("elements.yml")
  return unless @elements

  @elements.each do |element|
    @element = element
    @contents = element["contents"] || []
    @element_name = element_name(element)
    conditional_template "view.html.#{template_engine}", "#{elements_dir}/_#{@element_name}.html.#{template_engine}"
  end
end