class Administrate::ViewGenerator

Public Class Methods

template_source_path() click to toggle source
# File lib/administrate/view_generator.rb, line 8
def self.template_source_path
  File.expand_path(
    "../../../app/views/administrate/application",
    __FILE__,
  )
end

Private Instance Methods

copy_resource_template(template_name) click to toggle source
# File lib/administrate/view_generator.rb, line 17
def copy_resource_template(template_name)
  template_file = "#{template_name}.html.erb"

  copy_file(
    template_file,
    "app/views/admin/#{resource_path}/#{template_file}",
  )
end
resource_path() click to toggle source
# File lib/administrate/view_generator.rb, line 26
def resource_path
  args.first.try(:underscore).try(:pluralize) || BaseResourcePath.new
end