app/controllers/trestle/admin_controller.rb
class Trestle::AdminController < Trestle::ApplicationController
if respond_to?(:raise_on_missing_callback_actions=)
self.raise_on_missing_callback_actions = false
end
def index
end
class << self
attr_reader :admin
private
def local_prefixes
return admin.view_path_prefixes if admin
[controller_path.sub(/\/$/, "")]
end
end
def admin
@_admin ||= self.class.admin.new(self)
end
helper_method :admin
protected
def breadcrumbs
@_breadcrumbs ||= admin.breadcrumbs.dup
end
def flash_message(type, title:, message:)
{
title: admin.t("flash.#{type}.title", default: title),
message: admin.t("flash.#{type}.message", default: message)
}
end
end