Sha256: 22e11d523cb81b728aa9bff3df6f566418132c2693df7f52ac93a35b33415335

Contents?: true

Size: 567 Bytes

Versions: 13

Compression:

Stored size: 567 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.erb", "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

13 entries across 13 versions & 1 rubygems

Version Path
typus-3.1.0.rc19 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc18 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc17 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc16 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc15 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc14 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc13 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc12 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc11 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc10 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc9 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc8 lib/generators/typus/controller_generator.rb
typus-3.1.0.rc7 lib/generators/typus/controller_generator.rb