Sha256: 17ea13587b9a0079c2850df70cbb7439203a80e7e90d87232483e0e69074fcf0

Contents?: true

Size: 997 Bytes

Versions: 121

Compression:

Stored size: 997 Bytes

Contents

require 'rails/generators/rails/resource/resource_generator'

module Rails
  module Generators
    class ScaffoldGenerator < ResourceGenerator # :nodoc:
      remove_hook_for :resource_controller
      remove_class_option :actions

      class_option :stylesheets, type: :boolean, desc: "Generate Stylesheets"
      class_option :stylesheet_engine, desc: "Engine for Stylesheets"
      class_option :assets, type: :boolean
      class_option :resource_route, type: :boolean

      def handle_skip
        @options = @options.merge(stylesheets: false) unless options[:assets]
        @options = @options.merge(stylesheet_engine: false) unless options[:stylesheets]
      end

      hook_for :scaffold_controller, required: true

      hook_for :assets do |assets|
        invoke assets, [controller_name]
      end

      hook_for :stylesheet_engine do |stylesheet_engine|
        if behavior == :invoke
          invoke stylesheet_engine, [controller_name]
        end
      end
    end
  end
end

Version data entries

121 entries across 117 versions & 9 rubygems

Version Path
railties-4.2.11.3 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.11.2 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.11.1 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.11 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.10 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.10.rc1 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.9 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.9.rc2 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.9.rc1 lib/rails/generators/rails/scaffold/scaffold_generator.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/railties-4.2.8/lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.8 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.8.rc1 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.7.1 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.7 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.1.16 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.1.16.rc1 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.7.rc1 lib/rails/generators/rails/scaffold/scaffold_generator.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/railties-4.2.6/lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.1.15 lib/rails/generators/rails/scaffold/scaffold_generator.rb
railties-4.2.6 lib/rails/generators/rails/scaffold/scaffold_generator.rb