Class: Bootstrap::Generators::LayoutGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Bootstrap::Generators::LayoutGenerator
- Includes:
- CdnTags
- Defined in:
- lib/generators/bootstrap/layout/layout_generator.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
Instance Method Summary collapse
Methods included from CdnTags
#bundle_tag, #css_tag, #js_tag, #popper_tag, #separate_popper_tags
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
21 22 23 |
# File 'lib/generators/bootstrap/layout/layout_generator.rb', line 21 def app_name @app_name end |
Instance Method Details
#generate_layout ⇒ Object
31 32 33 34 35 36 |
# File 'lib/generators/bootstrap/layout/layout_generator.rb', line 31 def generate_layout app = ::Rails.application @app_name = app.class.to_s.split("::").first ext = app.config.generators.[:rails][:template_engine] || :erb template "layout.html.#{ext}", "app/views/layouts/#{layout_name}.html.#{ext}" end |
#warn_about_ignored_options ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/generators/bootstrap/layout/layout_generator.rb', line 23 def return unless [:'separate-popper'] && !cdn? say_status :warn, "--separate-popper only applies with --cdn; the vendored asset pipeline ships the bundle. Ignoring.", :yellow end |