Class: WebAppTemplate::Layout

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/web_app_template/layout/layout_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_layoutObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/generators/web_app_template/layout/layout_generator.rb', line 13

def copy_layout
  layout = "#{options.template.underscore}.html.erb"
  case options.engine
    when 'erb'
      template  layout, "app/views/layouts/#{layout_name.underscore}.html.erb"
    when 'haml'
      generate_haml_layout layout
    when 'slim'
      generate_slim_layout layout
  end
end