Sha256: 1202d9043e4bc492d60e272e1a711ef294622aab83510720e05a224536bfdb31

Contents?: true

Size: 669 Bytes

Versions: 22

Compression:

Stored size: 669 Bytes

Contents

require 'generators/formtastic'
require 'rails/generators/resource_helpers'

module Formtastic
  module Generators
    class ScaffoldGenerator < Base
      include Rails::Generators::ResourceHelpers

      argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"

      class_option :template_engine

      def copy_form_file
        filename = filename_with_extensions("_form")
        template template_filename_with_extensions("_form"), File.join("app/views", controller_file_path, filename)
      end

      protected

        def handler
          options[:template_engine].to_s.gsub('erubis', 'erb')
        end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
rails3-generators-0.9.1 lib/generators/formtastic/scaffold/scaffold_generator.rb
rails3-generators-0.9.0 lib/generators/formtastic/scaffold/scaffold_generator.rb