Sha256: 56f2dfb2578cafc1b4d4e6b2ae3a39bd51522231e4bc93048273403d054148e1

Contents?: true

Size: 488 Bytes

Versions: 23

Compression:

Stored size: 488 Bytes

Contents

require "rails/generators"

module Generators
  module Avo
    class FieldGenerator < ::Rails::Generators::NamedBase
      source_root File.expand_path("templates", __dir__)

      namespace "avo:field"
      desc "Add a custom Avo field to your project."

      def handle
        directory "field/components", "app/components/avo/fields/#{singular_name}_field"
        template "field/%singular_name%_field.rb.tt", "app/avo/fields/#{singular_name}_field.rb"
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
avo-1.7.2 lib/generators/avo/field_generator.rb
avo-1.7.1 lib/generators/avo/field_generator.rb
avo-1.7.0 lib/generators/avo/field_generator.rb
avo-1.6.4.pre.1 lib/generators/avo/field_generator.rb
avo-1.6.3.pre.3 lib/generators/avo/field_generator.rb
avo-1.6.3.pre.2 lib/generators/avo/field_generator.rb
avo-1.6.3.pre.1 lib/generators/avo/field_generator.rb
avo-1.6.2.pre.1 lib/generators/avo/field_generator.rb
avo-1.6.1 lib/generators/avo/field_generator.rb
avo-1.6.0 lib/generators/avo/field_generator.rb
avo-1.5.5 lib/generators/avo/field_generator.rb
avo-1.5.4 lib/generators/avo/field_generator.rb
avo-1.5.3 lib/generators/avo/field_generator.rb
avo-1.5.2 lib/generators/avo/field_generator.rb
avo-1.5.1 lib/generators/avo/field_generator.rb
avo-1.5.0 lib/generators/avo/field_generator.rb
avo-1.4.5.pre.1 lib/generators/avo/field_generator.rb
avo-1.4.4.pre.1 lib/generators/avo/field_generator.rb
avo-1.4.4 lib/generators/avo/field_generator.rb
avo-1.4.3 lib/generators/avo/field_generator.rb