Class: Cms::Generators::TemplateGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/cms/template/template_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_templateObject



8
9
10
11
12
13
14
15
16
# File 'lib/generators/cms/template/template_generator.rb', line 8

def create_template
  if mobile?
    subdir = 'mobile'
  else
    subdir = 'templates'
  end
  template_dir = "app/views/layouts/#{subdir}"
  template 'template.erb', File.join(template_dir, "#{template_name}.html.erb")
end