class ActiveAdmin::Resource


by calling the #active_admin_config method.
The instance of the current resource is available in ResourceController and views
a new Resource instance within the given Namespace.
When you register a resource (ActiveAdmin.register Post) you are actually creating
Resource is the primary data storage for resource configuration in Active Admin

def admin_notes?

Are admin notes turned on for this resource
def admin_notes?
  admin_notes.nil? ? ActiveAdmin.admin_notes : admin_notes
end

def belongs_to(target, options = {})

def belongs_to(target, options = {})
  @belongs_to = Resource::BelongsTo.new(self, target, options)
  controller.belongs_to(target, options.dup)
end

def belongs_to?

Do we belong to another resource
def belongs_to?
  !belongs_to_config.nil?
end

def belongs_to_config

def belongs_to_config
  @belongs_to
end

def clear_collection_actions!

def clear_collection_actions!
  @collection_actions = []
end

def clear_member_actions!

Clears all the member actions this resource knows about
def clear_member_actions!
  @member_actions = []
end

def controller

Returns the controller for this resource
def controller
  @controller ||= controller_name.constantize
end

def controller_name

resource within its namespace
Returns a properly formatted controller name for this
def controller_name
  [namespace.module_name, camelized_resource_name.pluralize + "Controller"].compact.join('::')
end

def csv_builder

The csv builder for this resource
def csv_builder
  @csv_builder || default_csv_builder
end

def default_csv_builder

def default_csv_builder
  @default_csv_builder ||= CSVBuilder.default_for_resource(resource)
end

def default_options

def default_options
  {
    :namespace  => ActiveAdmin.application.default_namespace,
    :sort_order => "#{resource.respond_to?(:primary_key) ? resource.primary_key : 'id'}_desc"
  }
end

def resource_table_name

def resource_table_name
  resource.quoted_table_name
end

def route_collection_path

collection of this resource
Returns a symbol for the route to use to get to the
def route_collection_path
  route = [route_prefix, controller.resources_configuration[:self][:route_collection_name]]
  if controller.resources_configuration[:self][:route_collection_name] ==
      controller.resources_configuration[:self][:route_instance_name]
    route << "index"
  end
  route << 'path'
  route.compact.join('_').to_sym
end

def route_instance_path

Returns the named route for an instance of this resource
def route_instance_path
  [route_prefix, controller.resources_configuration[:self][:route_instance_name], 'path'].compact.join('_').to_sym
end

def route_prefix

Returns the routes prefix for this resource
def route_prefix
  namespace.module_name.try(:underscore)
end