Sha256: f4452a9183a6296f98e65266c632282c79dcc82dadcbbb1558e3ca47bd597a9e
Contents?: true
Size: 753 Bytes
Versions: 8
Compression:
Stored size: 753 Bytes
Contents
require 'rails/generators' module Foundation module Generators class LayoutGenerator < Rails::Generators::Base source_root File.join(File.dirname(__FILE__), 'templates') argument :layout_name, :type => :string, :default => 'application', :banner => 'layout_name' class_option :haml, :desc => 'Generate HAML layout instead of ERB.', :type => :boolean def create_layout if options.haml? template 'application.html.haml', "app/views/layouts/#{file_name}.html.haml" else template 'application.html.erb', "app/views/layouts/#{file_name}.html.erb" end end private def file_name layout_name.underscore.downcase end end end end
Version data entries
8 entries across 8 versions & 1 rubygems