Sha256: ea83cad80ebcd347118d3c6602ed8c77f99a34c9de9b747e4a94189757b68218
Contents?: true
Size: 751 Bytes
Versions: 39
Compression:
Stored size: 751 Bytes
Contents
# frozen_string_literal: true require "rails/generators/resource_helpers" require "rails/generators/rails/model/model_generator" module Rails module Generators class ResourceGenerator < ModelGenerator # :nodoc: include ResourceHelpers hook_for :resource_controller, required: true do |controller| invoke controller, [ controller_name, options[:actions] ] end class_option :actions, type: :array, banner: "ACTION ACTION", default: [], desc: "Actions for the resource controller" hook_for :resource_route, required: true class << self def desc(description = nil) ERB.new(File.read(usage_path)).result(binding) end end end end end
Version data entries
39 entries across 39 versions & 5 rubygems