Sha256: 1220ba51a7f6c0cfc947a1b2f2547bd333fbf17866815a0adfb2cd8a5b6c34f0

Contents?: true

Size: 750 Bytes

Versions: 47

Compression:

Stored size: 750 Bytes

Contents

require_relative "named_base_generator"
require_relative "concerns/parent_controller"
require_relative "concerns/override_controller"

module Generators
  module Avo
    class ControllerGenerator < NamedBaseGenerator
      include Concerns::ParentController
      include Concerns::OverrideController

      source_root File.expand_path("templates", __dir__)

      namespace "avo:controller"

      def create
        return if override_controller?

        template "resource/controller.tt", "app/controllers/avo/#{controller_name}.rb"
      end

      private

      def controller_name
        "#{plural_name}_controller"
      end

      def controller_class
        "Avo::#{class_name.camelize.pluralize}Controller"
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
avo-3.14.3 lib/generators/avo/controller_generator.rb
avo-3.14.2 lib/generators/avo/controller_generator.rb
avo-3.14.1 lib/generators/avo/controller_generator.rb
avo-3.14.0 lib/generators/avo/controller_generator.rb
avo-3.13.7 lib/generators/avo/controller_generator.rb
avo-3.13.6 lib/generators/avo/controller_generator.rb
avo-3.13.5 lib/generators/avo/controller_generator.rb
avo-3.13.4 lib/generators/avo/controller_generator.rb
avo-3.13.3 lib/generators/avo/controller_generator.rb
avo-3.13.2 lib/generators/avo/controller_generator.rb
avo-3.13.1 lib/generators/avo/controller_generator.rb
avo-3.13.0 lib/generators/avo/controller_generator.rb
avo-3.12.0 lib/generators/avo/controller_generator.rb
avo-3.11.10 lib/generators/avo/controller_generator.rb
avo-3.11.9 lib/generators/avo/controller_generator.rb
avo-3.11.8 lib/generators/avo/controller_generator.rb
avo-3.11.7 lib/generators/avo/controller_generator.rb
avo-3.11.6 lib/generators/avo/controller_generator.rb
avo-3.11.5 lib/generators/avo/controller_generator.rb
avo-3.11.4 lib/generators/avo/controller_generator.rb