Class: Alchemy::Generators::SiteLayoutsGenerator
- Inherits:
-
Base
- Object
- Rails::Generators::Base
- Base
- Alchemy::Generators::SiteLayoutsGenerator
- Defined in:
- lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_directory ⇒ Object
9 10 11 12 |
# File 'lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb', line 9 def create_directory @site_layouts_dir = "#{Rails.root}/app/views/alchemy/site_layouts" empty_directory @site_layouts_dir end |
#create_partials ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb', line 14 def create_partials @sites = Alchemy::Site.all @sites.each do |site| @site_name = site.name.parameterize.underscore conditional_template "layout.html.#{template_engine}", "#{@site_layouts_dir}/_#{@site_name}.html.#{template_engine}" end if @sites end |