Sha256: 32ef848f9760a7cc9af717ba25ebd5f54d1bc8796af1a5c4d25fb923d9fc7a01
Contents?: true
Size: 879 Bytes
Versions: 3
Compression:
Stored size: 879 Bytes
Contents
#require 'rails/generators/rails/scaffold_controller/scaffold_controller_generator' module Rails module Generators class ActiveScaffoldControllerGenerator < NamedBase #metagenerator include ResourceHelpers def self.source_root @source_root ||= File.join(File.dirname(__FILE__), 'templates') end check_class_collision :suffix => "Controller" class_option :orm, :banner => "NAME", :type => :string, :required => true, :desc => "ORM to generate the controller for" def create_controller_files template 'controller.rb', File.join('app/controllers', class_path, "#{controller_file_name}_controller.rb") end hook_for :test_framework, :as => :scaffold def create_view_root_folder empty_directory File.join("app/views", controller_file_path) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems