Sha256: 3bbf791769e5f6996cc4a4e0af602fad8a69a0a3536ad9b8144593e9b6587bda

Contents?: true

Size: 675 Bytes

Versions: 2

Compression:

Stored size: 675 Bytes

Contents

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

module Pom
  module Generators
    class ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
      source_root File.expand_path(File.join('..', 'templates'), __FILE__)

      def copy_view_files
        available_views.each do |view|
          filename = filename_with_extensions view
          template "#{view}.html.pom", File.join('app', 'views', controller_file_path, filename)
        end
      end

      hook_for :form_builder, as: :scaffold

      protected
      def available_views
        ['index', 'edit', 'show', 'new', '_form']
      end

      def handler
        :pom
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
coprl-3.0.0.beta.11 lib/generators/pom/scaffold/scaffold_generator.rb
coprl-3.0.0.beta.10 lib/generators/pom/scaffold/scaffold_generator.rb