Sha256: 9393863e5de05c3b6ec55780ed45b1e02ff77bf18b311734eec0b2d971553348

Contents?: true

Size: 770 Bytes

Versions: 48

Compression:

Stored size: 770 Bytes

Contents

require 'rails/generators'
require 'rails/generators/erb/scaffold/scaffold_generator'

module Incline::Extensions
  ##
  # Adds one more view to the standard ERB views.
  module ErbScaffoldGenerator
    ##
    # Override the "available_views" method to return one more view.
    def self.included(base)
      base.class_eval do
        # point to our templates.
        source_root File.expand_path('../../../templates/erb/scaffold', __FILE__)

        protected

        undef available_views

        # the _list view can be included as a partial for parent items.
        def available_views
          %w(index new edit show _list _form)
        end

      end
    end

  end
end

Erb::Generators::ScaffoldGenerator.include Incline::Extensions::ErbScaffoldGenerator

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
incline-0.3.14 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.13 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.12 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.11 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.10 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.9 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.8 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.7 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.6 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.5 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.4 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.3 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.2 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.1 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.3.0 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.36 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.35 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.34 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.28 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.27 lib/incline/extensions/erb_scaffold_generator.rb