aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators/rails/controller/controller_generator.rb
blob: ea406c96e7afaa068ec118e27ebd1f4b68cc2a30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Rails
  module Generators
    class ControllerGenerator < NamedBase
      argument :actions, :type => :array, :default => [], :banner => "action action"
      check_class_collision :suffix => "Controller"

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

      invoke_for :template_engine, :test_framework
      invoke_if :helper, :aliases => "-v"
    end
  end
end