Sha256: 69c32b901bb51e6d753d9b0745bbc4f38142d5619e4682c53753aea56cd773e7

Contents?: true

Size: 553 Bytes

Versions: 4

Compression:

Stored size: 553 Bytes

Contents

require 'rails/generators'

module Pages
  module Generators
    class HomeGenerator < ::Rails::Generators::Base
      source_root File.expand_path("../templates", __FILE__)

      desc "Create a home page"

      def create_page
        copy_file 'index.html.erb', 'app/views/visitors/index.html.erb'
        copy_file 'visitors_controller.rb', 'app/controllers/visitors_controller.rb'
        route = '  root :to => "visitors#index"'
        inject_into_file 'config/routes.rb', route + "\n", :after => "routes.draw do\n"
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_apps_pages-0.3.1 lib/generators/pages/home/home_generator.rb
rails_apps_pages-0.3.0 lib/generators/pages/home/home_generator.rb
rails_apps_pages-0.2.0 lib/generators/pages/home/home_generator.rb
rails_apps_pages-0.1.0 lib/generators/pages/home/home_generator.rb