Controllers
Trek::BaseController— the base for all admin controllers: authentication, authorization, localization, theadminlayout and Trek's form builder.Trek::ResourceController— extendsBaseControllerwith the full CRUD (index,show,new,create,edit,update,destroy), wired to ActionPolicy (authorized_scope,authorize!) and ordering. Scaffolded controllers inherit from it and only need to declare theirmodel:
ruby
module Admin
class BooksController < Trek::ResourceController
private
def model
Book
end
end
end- Panel controllers (
Trek::Panels::*) — support endpoints used by the admin UI: image uploads (Uppy), link insertion and content editor prompts.
Mixins
include Trek::Pagination— paginates the index with Kaminariinclude Trek::Search— filters the index byparams[:search]when the model is Searchable