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.2.26 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.25 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.24 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.23 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.22 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.21 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.20 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.19 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.18 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.17 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.16 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.15 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.14 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.13 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.12 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.11 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.10 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.9 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.8 lib/incline/extensions/erb_scaffold_generator.rb
incline-0.2.7 lib/incline/extensions/erb_scaffold_generator.rb