Sha256: ddbe607077a3b28cee3f900611829ddbeac1fbdef1881504d2ab1cff9d08e20a
Contents?: true
Size: 841 Bytes
Versions: 17
Compression:
Stored size: 841 Bytes
Contents
require "administrate/view_generator" module Administrate module Generators module Views class FieldGenerator < Administrate::ViewGenerator def self.template_source_path File.expand_path( "../../../../../app/views/fields/", __FILE__, ) end source_root template_source_path def copy_partials copy_field_partial(:index) copy_field_partial(:show) copy_field_partial(:form) end private def copy_field_partial(partial_name) resource_path = args.first.try(:underscore) template_file = "#{resource_path}/_#{partial_name}.html.erb" copy_file( template_file, "app/views/fields/#{template_file}", ) end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems