Sha256: 1288143b9c801e2000856838f755bdd4b466ca67d0502b588bfaa2463dedb2ef

Contents?: true

Size: 610 Bytes

Versions: 12

Compression:

Stored size: 610 Bytes

Contents

require 'active_admin/generators/boilerplate'

module ActiveAdmin
  module Generators
    class ResourceGenerator < Rails::Generators::NamedBase
      desc "Registers resources with Active Admin"

      class_option :include_boilerplate, type: :boolean, default: false,
        desc: "Generate boilerplate code for your resource."

      source_root File.expand_path('templates', __dir__)

      def generate_config_file
        @boilerplate = ActiveAdmin::Generators::Boilerplate.new(class_name)
        template "admin.rb.erb", "app/admin/#{file_path.tr('/', '_').pluralize}.rb"
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
activeadmin-2.7.0 lib/generators/active_admin/resource/resource_generator.rb
activeadmin-2.6.1 lib/generators/active_admin/resource/resource_generator.rb
activeadmin-2.6.0 lib/generators/active_admin/resource/resource_generator.rb
activeadmin-2.5.0 lib/generators/active_admin/resource/resource_generator.rb
activeadmin-2.4.0 lib/generators/active_admin/resource/resource_generator.rb
activeadmin-2.3.1 lib/generators/active_admin/resource/resource_generator.rb
activeadmin-2.3.0 lib/generators/active_admin/resource/resource_generator.rb
activeadmin-2.2.0 lib/generators/active_admin/resource/resource_generator.rb
activeadmin-2.1.0 lib/generators/active_admin/resource/resource_generator.rb
activeadmin-2.0.0 lib/generators/active_admin/resource/resource_generator.rb
activeadmin-2.0.0.rc2 lib/generators/active_admin/resource/resource_generator.rb
activeadmin-2.0.0.rc1 lib/generators/active_admin/resource/resource_generator.rb