Sha256: 31ff0c53752a5e1bb3977c76d268b3d0a817e9276d9e8a5d9387b0e0c1b37c5c

Contents?: true

Size: 721 Bytes

Versions: 29

Compression:

Stored size: 721 Bytes

Contents

require 'rails/generators/rails/resource/resource_generator'
# require 'generators/active_scaffold_controller/active_scaffold_controller_generator'

module Rails
  module Generators
    class ActiveScaffoldGenerator < ResourceGenerator # metagenerator
      remove_hook_for :resource_controller
      remove_hook_for :resource_route
      remove_class_option :actions

      def add_resource_route
        route_config =  class_path.collect { |namespace| "namespace :#{namespace} do " }.join(' ')
        route_config << "resources :#{file_name.pluralize} do as_routes end"
        route_config << ' end' * class_path.size
        route route_config
      end

      invoke 'active_scaffold_controller'
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
active_scaffold-3.4.43 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.42 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.41.1 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.41 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.40 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.39 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.38 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.37 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.36 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.35 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.34 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.33 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.32 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.31 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.30 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.29 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.28 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.27 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.26 lib/generators/active_scaffold/active_scaffold_generator.rb
active_scaffold-3.4.25 lib/generators/active_scaffold/active_scaffold_generator.rb