Sha256: 1220ba51a7f6c0cfc947a1b2f2547bd333fbf17866815a0adfb2cd8a5b6c34f0

Contents?: true

Size: 750 Bytes

Versions: 49

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

49 entries across 49 versions & 1 rubygems

Version Path
avo-3.11.5 lib/generators/avo/controller_generator.rb
avo-3.11.4 lib/generators/avo/controller_generator.rb
avo-3.11.3 lib/generators/avo/controller_generator.rb
avo-3.11.2 lib/generators/avo/controller_generator.rb
avo-3.11.1 lib/generators/avo/controller_generator.rb
avo-3.11.0 lib/generators/avo/controller_generator.rb
avo-3.10.10 lib/generators/avo/controller_generator.rb
avo-3.10.9 lib/generators/avo/controller_generator.rb
avo-3.10.8 lib/generators/avo/controller_generator.rb
avo-3.10.7 lib/generators/avo/controller_generator.rb
avo-3.10.6 lib/generators/avo/controller_generator.rb
avo-3.10.5 lib/generators/avo/controller_generator.rb
avo-3.10.4 lib/generators/avo/controller_generator.rb
avo-3.10.3 lib/generators/avo/controller_generator.rb
avo-3.10.2 lib/generators/avo/controller_generator.rb
avo-3.10.1 lib/generators/avo/controller_generator.rb
avo-3.10.0 lib/generators/avo/controller_generator.rb
avo-3.9.2 lib/generators/avo/controller_generator.rb
avo-3.9.1 lib/generators/avo/controller_generator.rb
avo-3.8.2 lib/generators/avo/controller_generator.rb