Sha256: a547e8e4a9cb478706d6ad438cd1370806562cb6b4f80c6d66cf95ed82baf419

Contents?: true

Size: 367 Bytes

Versions: 3

Compression:

Stored size: 367 Bytes

Contents

# frozen_string_literal: true

module ActiveFormModel
  module Generators
    class FormGenerator < ::Rails::Generators::NamedBase
      class_option :model, type: :string
      source_root File.expand_path('templates', __dir__)

      def create_form
        template 'form.rb', File.join('app/forms', class_path, "#{file_name}_form.rb")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_form_model-0.5.1 lib/generators/active_form_model/form_generator.rb
active_form_model-0.3.0 lib/generators/active_form_model/form_generator.rb
active_form_model-0.2.0 lib/generators/active_form_model/form_generator.rb