class Administrate::ViewGenerator

Public Class Methods

template_source_path() click to toggle source
# File lib/administrate/view_generator.rb, line 15
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 28
def copy_resource_template(template_name)
  template_file = "#{template_name}.html.erb"

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