Sha256: 4c4c3f1b3f959dafdcd6e4aa5a82a662b95618b8c5891e80722526e8f65b537e
Contents?: true
Size: 849 Bytes
Versions: 11
Compression:
Stored size: 849 Bytes
Contents
require 'rails/generators' module Groundworkcss module Generators class LayoutGenerator < ::Rails::Generators::Base source_root File.expand_path("../templates", __FILE__) desc "This generator generates layout file with navigation." argument :layout_name, :type => :string, :default => "application" attr_reader :app_name, :container_class def generate_layout app = ::Rails.application @app_name = app.class.to_s.split("::").first ext = app.config.generators.options[:rails][:template_engine] || :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/_sidebar.html.#{ext}" end end end end
Version data entries
11 entries across 11 versions & 1 rubygems