Sha256: d678caf04ce927ac0ff82968cdc1de2fa92660137557820ea99b5fe770615e8d

Contents?: true

Size: 568 Bytes

Versions: 24

Compression:

Stored size: 568 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

24 entries across 24 versions & 2 rubygems

Version Path
brainsome_typus-4.0.0.beta13 lib/generators/typus/controller_generator.rb
brainsome_typus-4.0.0.beta12 lib/generators/typus/controller_generator.rb
brainsome_typus-4.0.0.beta11 lib/generators/typus/controller_generator.rb
brainsome_typus-4.0.0.beta10 lib/generators/typus/controller_generator.rb
brainsome_typus-4.0.0.beta9 lib/generators/typus/controller_generator.rb
brainsome_typus-4.0.0.beta8 lib/generators/typus/controller_generator.rb
brainsome_typus-4.0.0.beta7 lib/generators/typus/controller_generator.rb
brainsome_typus-4.0.0.beta6 lib/generators/typus/controller_generator.rb
brainsome_typus-4.0.0.beta5 lib/generators/typus/controller_generator.rb
brainsome_typus-4.0.0.beta4 lib/generators/typus/controller_generator.rb
brainsome_typus-4.0.0.beta3 lib/generators/typus/controller_generator.rb
brainsome_typus-4.0.0.beta2 lib/generators/typus/controller_generator.rb
brainsome_typus-4.0.0.beta1 lib/generators/typus/controller_generator.rb
typus-3.1.10 lib/generators/typus/controller_generator.rb
typus-3.1.9 lib/generators/typus/controller_generator.rb
typus-3.1.8 lib/generators/typus/controller_generator.rb
typus-3.1.7 lib/generators/typus/controller_generator.rb
typus-3.1.6 lib/generators/typus/controller_generator.rb
typus-3.1.5 lib/generators/typus/controller_generator.rb
typus-3.1.4 lib/generators/typus/controller_generator.rb