Sha256: 8c4abe2479899aca34006681222fe49b92d129821b510420d0aec330b269f837

Contents?: true

Size: 682 Bytes

Versions: 10

Compression:

Stored size: 682 Bytes

Contents

require 'rails/generators/resource_helpers'

module Iord
  module Generators
    class ControllerGenerator < Rails::Generators::NamedBase
      include Rails::Generators::ResourceHelpers

      def self.source_root
        @_iord_source_root ||= File.expand_path("../templates", __FILE__)
      end

      check_class_collision suffix: 'Controller'

      class_option :resource_route, type: :boolean

      def create_controller_files
        template 'controller.rb', File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")
      end

      hook_for :test_framework, as: :scaffold
      hook_for :resource_route, in: :rails
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
iord-1.2.2 lib/rails/generators/iord/controller/controller_generator.rb
iord-1.2.1 lib/rails/generators/iord/controller/controller_generator.rb
iord-1.2.0 lib/rails/generators/iord/controller/controller_generator.rb
iord-1.1.3 lib/rails/generators/iord/controller/controller_generator.rb
iord-1.1.2 lib/rails/generators/iord/controller/controller_generator.rb
iord-1.1.1 lib/rails/generators/iord/controller/controller_generator.rb
iord-1.1.0 lib/rails/generators/iord/controller/controller_generator.rb
iord-1.0.3 lib/rails/generators/iord/controller/controller_generator.rb
iord-1.0.2 lib/rails/generators/iord/controller/controller_generator.rb
iord-1.0.1 lib/rails/generators/iord/controller/controller_generator.rb