Sha256: 3f84ccb48c03959d39e929eb74bb4cc4084f10c945f145929c376fc983eeda26
Contents?: true
Size: 796 Bytes
Versions: 8
Compression:
Stored size: 796 Bytes
Contents
require 'rails/generators/resource_helpers' module Rails class HelperlessScaffoldControllerGenerator < Rails::Generators::NamedBase include Rails::Generators::ResourceHelpers check_class_collision suffix: "Controller" class_option :orm, banner: "NAME", type: :string, required: true, desc: "ORM to generate the controller for" argument :attributes, type: :array, default: [], banner: "field:type field:type" def create_controller_files template "controller.rb", File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb") end def self.source_root @source_root ||= File.join(File.dirname(__FILE__), 'templates') end hook_for :template_engine, :test_framework, as: :scaffold end end
Version data entries
8 entries across 8 versions & 1 rubygems