Class: Groundworkcss::Generators::LayoutGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Groundworkcss::Generators::LayoutGenerator
- Defined in:
- lib/generators/groundworkcss/layout/layout_generator.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#container_class ⇒ Object
readonly
Returns the value of attribute container_class.
Instance Method Summary collapse
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
9 10 11 |
# File 'lib/generators/groundworkcss/layout/layout_generator.rb', line 9 def app_name @app_name end |
#container_class ⇒ Object (readonly)
Returns the value of attribute container_class.
9 10 11 |
# File 'lib/generators/groundworkcss/layout/layout_generator.rb', line 9 def container_class @container_class end |
Instance Method Details
#generate_layout ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/generators/groundworkcss/layout/layout_generator.rb', line 11 def generate_layout app = ::Rails.application @app_name = app.class.to_s.split("::").first ext = :erb template "layout.html.#{ext}", "app/views/layouts/#{layout_name}.html.#{ext}" copy_file "_sidebar.html.#{ext}", "app/views/layouts/_sidebar.html.#{ext}" copy_file "_header.html.#{ext}", "app/views/layouts/_header.html.#{ext}" end |