Sha256: 7102b0592d1961b4fe27a629e08b80792cc5f19729dc78a99e788cf217b64c70

Contents?: true

Size: 566 Bytes

Versions: 17

Compression:

Stored size: 566 Bytes

Contents

module Typus
  module Generators
    class ControllerGenerator < Rails::Generators::NamedBase

      source_root File.expand_path("../../templates", __FILE__)

      alias_method :resource, :name

      desc <<-MSG
Description:
  Generates admin controllers for the given resource

      MSG

      def generate_controller
        template "controller.rb", "app/controllers/admin/#{file_name}_controller.rb"
      end

      hook_for :test_framework do |instance, generator|
        instance.invoke generator, ["admin/#{instance.name}"]
      end

    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
typus-3.0.12 lib/generators/typus/controller_generator.rb
typus-3.0.11 lib/generators/typus/controller_generator.rb
typus-3.0.11.rc5 lib/generators/typus/controller_generator.rb
typus-3.0.11.rc4 lib/generators/typus/controller_generator.rb
typus-3.0.11.rc3 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc6 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc5 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc4 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc3 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc2 lib/generators/typus/controller_generator.rb
typus-3.0.11.rc2 lib/generators/typus/controller_generator.rb
typus-3.0.11.rc1 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc1 lib/generators/typus/controller_generator.rb
typus-3.0.10 lib/generators/typus/controller_generator.rb
typus-3.0.9 lib/generators/typus/controller_generator.rb
typus-3.0.8 lib/generators/typus/controller_generator.rb
typus-3.0.7 lib/generators/typus/controller_generator.rb