Sha256: edfc0ea65cd6ba70b7de932fe2e80b9eb11a92912bea1593227b6144ca54b93f

Contents?: true

Size: 821 Bytes

Versions: 6

Compression:

Stored size: 821 Bytes

Contents

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

module RogersScaffold
  module Generators
    class RogersScaffoldGenerator < ::Rails::Generators::ScaffoldGenerator
      include ::RogersScaffold::Base

      # override ScaffoldGenerator
      hook_for :scaffold_controller, :required => true

      # Ensure assets get created with the correct name
      hook_for :assets, :in => :rails do |source, generator|
        source.invoke generator, [ source.file_name.pluralize ]
      end

      # override ModelGenerator
      hook_for :orm, :required => true

      # replacing hook for adding config/routes
      remove_hook_for :resource_route
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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