Class: NoCms::Blocks::LayoutGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.namespaceObject



22
23
24
# File 'lib/generators/nocms/blocks/layout_generator.rb', line 22

def self.namespace
  "nocms:blocks:layout"
end

Instance Method Details

#generate_initializerObject



18
19
20
# File 'lib/generators/nocms/blocks/layout_generator.rb', line 18

def generate_initializer
  template "config/initializers/nocms/blocks/layout.rb", File.join(destination_root, "config/initializers/nocms/blocks", "#{name}.rb")
end

#generate_stylesheetsObject



9
10
11
# File 'lib/generators/nocms/blocks/layout_generator.rb', line 9

def generate_stylesheets
  template "app/assets/stylesheets/no_cms/blocks/layout.scss.erb", File.join(destination_root, "app/assets/stylesheets/no_cms/blocks", "_#{name}.scss")
end

#generate_viewsObject



13
14
15
16
# File 'lib/generators/nocms/blocks/layout_generator.rb', line 13

def generate_views
  template "app/views/no_cms/blocks/blocks/layout.html.erb", File.join(destination_root, "app/views/no_cms/blocks/blocks", "_#{name}.html.erb")
  template "app/views/no_cms/admin/blocks/blocks/layout.html.erb", File.join(destination_root, "app/views/no_cms/admin/blocks/blocks", "_#{name}.html.erb")
end