Sha256: 26a4af47d586cc5874be03bdfbaad4bd9c8aae3665b5cf0036d07386e3e270a8

Contents?: true

Size: 834 Bytes

Versions: 6

Compression:

Stored size: 834 Bytes

Contents

require 'rails/generators/rails/scaffold_controller/scaffold_controller_generator'
require File.join(File.dirname(__FILE__), '../erb/erb_generator')
require File.join(File.dirname(__FILE__), '../base')

module RogersScaffold
  module Generators
    class ScaffoldControllerGenerator < ::Rails::Generators::ScaffoldControllerGenerator
      include ::RogersScaffold::Base

      source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates'))

#      source_root File.expand_path('../templates', __FILE__)

      # override ScaffoldControllerGenerator
      hook_for :template_engine
      hook_for :test_framework, :in => 'rogers_scaffold:scaffold'

      # override ScaffoldControllerGenerator
      hook_for :helper, :as => :scaffold do |invoked|
        invoke invoked, [ controller_name ]
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rogers_scaffold-0.1.6 lib/generators/rogers_scaffold/scaffold_controller/scaffold_controller_generator.rb
rogers_scaffold-0.1.5 lib/generators/rogers_scaffold/scaffold_controller/scaffold_controller_generator.rb
rogers_scaffold-0.1.4 lib/generators/rogers_scaffold/scaffold_controller/scaffold_controller_generator.rb
rogers_scaffold-0.1.3 lib/generators/rogers_scaffold/scaffold_controller/scaffold_controller_generator.rb
rogers_scaffold-0.1.2 lib/generators/rogers_scaffold/scaffold_controller/scaffold_controller_generator.rb
rogers_scaffold-0.1.1 lib/generators/rogers_scaffold/scaffold_controller/scaffold_controller_generator.rb