Class: Elasticss::Generators::LayoutGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Elasticss::Generators::LayoutGenerator
- Defined in:
- lib/generators/elasticss/layout/layout_generator.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
Instance Method Summary collapse
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
18 19 20 |
# File 'lib/generators/elasticss/layout/layout_generator.rb', line 18 def app_name @app_name end |
Instance Method Details
#generate_layout ⇒ Object
20 21 22 23 24 25 |
# File 'lib/generators/elasticss/layout/layout_generator.rb', line 20 def generate_layout app = ::Rails.application @app_name = app.class.to_s.split("::").first ext = app.config.generators.[:rails][:template_engine] || :erb template "layout_#{layout_type}.html.#{ext}", "app/views/layouts/application.html.#{ext}" end |