Sha256: 0d6a6e01b54e186caf50ca3ac9bffb37d90f401ba32aba871586aa6df8d1563b
Contents?: true
Size: 757 Bytes
Versions: 12
Compression:
Stored size: 757 Bytes
Contents
module Madmin module Generators class FieldGenerator < Rails::Generators::NamedBase include Madmin::GeneratorHelpers source_root File.expand_path("../templates", __FILE__) def eager_load Rails.application.eager_load! end def generate_field template "field.rb", "app/madmin/fields/#{file_path}_field.rb" copy_resource_template "_form" copy_resource_template "_index" copy_resource_template "_show" end private def copy_resource_template(template_name) template_file = "#{template_name}.html.erb" copy_file( template_file, "app/views/madmin/fields/#{file_path}_field/#{template_file}" ) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems