Class: Datalab::Generators::LayoutGenerator

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

Instance Method Summary collapse

Methods inherited from Base

banner, source_root

Instance Method Details

#create_layoutObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/generators/datalab/layout/layout_generator.rb', line 12

def create_layout
  if options.admin?
    template 'admin.html.erb', "app/views/layouts/#{file_name}.html.erb"
    copy_file 'admin.css.scss', "app/assets/stylesheets/#{file_name}.css.scss"
    copy_file 'admin_helper.rb', 'app/helpers/admin_helper.rb'
  elsif options.public?
    template 'public.html.erb', "app/views/layouts/#{file_name}.html.erb"
    copy_file 'public.css.scss', "app/assets/stylesheets/#{file_name}.css.scss"
    copy_file 'public_helper.rb', 'app/helpers/public_helper.rb'
  else
    template 'layout.html.erb', "app/views/layouts/#{file_name}.html.erb"
    copy_file 'stylesheet.css.scss', "app/assets/stylesheets/#{file_name}.css.scss"
    copy_file 'layout_helper.rb', 'app/helpers/layout_helper.rb'
  end
end