Sha256: 408b205b8a1a36ad45bb33a70345349c35eca1e17b8c8a1b3f124a45122de24a

Contents?: true

Size: 567 Bytes

Versions: 24

Compression:

Stored size: 567 Bytes

Contents

module Tao
  module Generators

    class ControllerGenerator < Rails::Generators::NamedBase
      source_root File.expand_path('../templates', __FILE__)

      argument :actions, type: :array, default: %w(index new create edit update show destroy), banner: "action action"

      check_class_collision suffix: "Controller"

      attr_reader :resource

      def create_controller_file
        @resource = file_name.singularize
        template "controller.rb.erb", File.join('app/controllers', class_path, "#{file_name}_controller.rb")
      end

    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
tao_on_rails-0.10.0 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.9.3 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.9.2 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.9.1 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.9.0 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.8.2 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.8.1 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.8.0 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.7.3 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.7.2 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.7.1 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.7.0 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.6.13 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.6.12 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.6.11 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.6.10 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.6.9 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.6.8 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.6.7 lib/generators/tao/controller/controller_generator.rb
tao_on_rails-0.6.6 lib/generators/tao/controller/controller_generator.rb