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



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

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

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