Class: Bootstrap::Generators::LayoutGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Bootstrap::Generators::LayoutGenerator
- Defined in:
- lib/generators/bootstrap/layout/layout_generator.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#container ⇒ Object
readonly
Returns the value of attribute container.
Instance Method Summary collapse
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
11 12 13 |
# File 'lib/generators/bootstrap/layout/layout_generator.rb', line 11 def app_name @app_name end |
#container ⇒ Object (readonly)
Returns the value of attribute container.
11 12 13 |
# File 'lib/generators/bootstrap/layout/layout_generator.rb', line 11 def container @container end |
Instance Method Details
#copy_files ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/generators/bootstrap/layout/layout_generator.rb', line 13 def copy_files @app_name = Rails.application.class.to_s.split("::").first @container= layout_type == "fixed" ? "container" : "container-fluid" ext = Rails.application.config.generators.[:rails][:template_engine] || :slim template "layout.html.#{ext}", "app/views/layouts/#{layout_name}.html.#{ext}" template "flash.html.#{ext}", "app/views/layouts/_flash.html.#{ext}" template "header.html.#{ext}", "app/views/application/_header.html.#{ext}" template "footer.html.#{ext}", "app/views/application/_footer.html.#{ext}" end |