Sha256: 3a932981fc3c7995acece6483dd4bb7d58035afcabd06ca1b6e8fce1f4647b42
Contents?: true
Size: 663 Bytes
Versions: 40
Compression:
Stored size: 663 Bytes
Contents
module Administrate module Generators class FieldGenerator < Rails::Generators::NamedBase source_root File.expand_path("../templates", __FILE__) def template_field_object template( "field_object.rb.erb", "app/fields/#{file_name}_field.rb", ) end def copy_partials copy_partial(:show) copy_partial(:index) copy_partial(:form) end private def copy_partial(partial_name) partial = "_#{partial_name}.html.erb" copy_file( partial, "app/views/fields/#{file_name}_field/#{partial}", ) end end end end
Version data entries
40 entries across 40 versions & 3 rubygems