Sha256: a2f93ff87fa6c528f73c626c17b4c20078d140cbdd50d21c1b913014335eb193

Contents?: true

Size: 636 Bytes

Versions: 63

Compression:

Stored size: 636 Bytes

Contents

require_relative "named_base_generator"
require_relative "concerns/parent_controller"

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

      source_root File.expand_path("templates", __dir__)

      namespace "avo:controller"

      def create
        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

63 entries across 63 versions & 1 rubygems

Version Path
avo-3.5.7 lib/generators/avo/controller_generator.rb
avo-3.5.6 lib/generators/avo/controller_generator.rb
avo-3.5.6.beta1 lib/generators/avo/controller_generator.rb
avo-3.5.5 lib/generators/avo/controller_generator.rb
avo-3.5.4 lib/generators/avo/controller_generator.rb
avo-3.5.3 lib/generators/avo/controller_generator.rb
avo-3.5.2 lib/generators/avo/controller_generator.rb
avo-3.5.1 lib/generators/avo/controller_generator.rb
avo-3.5.0 lib/generators/avo/controller_generator.rb
avo-3.4.4 lib/generators/avo/controller_generator.rb
avo-3.4.3 lib/generators/avo/controller_generator.rb
avo-3.4.2 lib/generators/avo/controller_generator.rb
avo-3.4.1 lib/generators/avo/controller_generator.rb
avo-3.4.0 lib/generators/avo/controller_generator.rb
avo-3.3.6 lib/generators/avo/controller_generator.rb
avo-3.3.5 lib/generators/avo/controller_generator.rb
avo-3.3.4 lib/generators/avo/controller_generator.rb
avo-3.3.3 lib/generators/avo/controller_generator.rb
avo-3.3.2 lib/generators/avo/controller_generator.rb
avo-3.3.1 lib/generators/avo/controller_generator.rb