Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/crashtech/torque-admin/llms.txt

Use this file to discover all available pages before exploring further.

Torque Admin is configured through a block-based API that mirrors the familiar Rails initializer pattern. Every option has a sensible default, so you only need to specify the settings that differ from what is shown in DEFAULT_CONFIG. Configuration can happen in an initializer file or directly inside the mount block in your routes.rb.
Place your configuration in config/initializers/torque_admin.rb before the engine mounts, or use the inline configure block available on the mount call in routes.rb. Either location works — the initializer approach is recommended when you have many options to set.

Configuration Methods

For the default admin application, call:
Torque::Admin.configure do |config|
  config.theme = 'bootstrap'
  config.default_authenticated = true
end
For a named admin application (when you mount more than one), call:
Torque::Admin[:staff].configure do |config|
  config.theme = 'bulma'
  config.parent_module = 'Staff'
end

All Configuration Options

title

title
nil | String | Proc | Symbol
default:"nil"
The display title of the admin application shown in the page header and browser tab.
  • nil — falls back to the application name derived from the mount name (e.g. "Admin")
  • String — rendered as plain text
  • Proc — the return value is rendered as raw HTML, giving you full control over markup
  • Symbol — treated as a helper method name; the helper is called and its return value is used
# Plain string
config.title = "Acme Admin"

# Proc returning HTML
config.title = -> { tag.span("Acme", class: "brand") + " Admin" }

# Symbol — calls the helper method `custom_admin_title`
config.title = :custom_admin_title

root_path

root_path
nil | String
default:"nil"
The URL root path at which the admin engine is mounted.When nil, Torque Admin automatically reads the path from the mount call in routes.rb and sets it for you. You only need to set this manually if you need to reference the path before routes are loaded, or if you mount the engine with a non-standard helper.
config.root_path = "/backend"

parent_module

parent_module
String
default:"'Object'"
The name of the Ruby module under which the admin application’s own module will be defined.'Object' means top-level scope, so a default admin app becomes the module Admin. Set this to nest the engine under an existing namespace — for example 'MyApp' would create MyApp::Admin.
config.parent_module = 'BackOffice'
# Creates BackOffice::Admin module

stream_actions

stream_actions
Boolean
default:"true"
Controls whether heavy listing actions such as index and dashboard pages use HTTP streaming by default.Streaming lets the browser start rendering while the server is still generating content, which improves perceived performance for pages with many records. Set to false to disable streaming globally and render responses in the traditional buffered way.
config.stream_actions = false

parallel_processing_with

parallel_processing_with
:concurrent_ruby | :async | false
default:":concurrent_ruby"
The concurrency back-end used to parallelise heavy operations (such as aggregating dashboard data or loading multiple widgets at once).
ValueBehaviour
:concurrent_rubyUses the concurrent-ruby gem’s thread-pool primitives
:asyncUses the async gem and its Fiber-based scheduler
falseDisables parallel processing entirely; work is done sequentially
config.parallel_processing_with = :async

isolate_namespace

isolate_namespace
nil | true | false
default:"nil"
Determines the degree of namespace isolation applied to the admin engine.
ValueBehaviour
nilHybrid — helpers and routes are isolated, but model naming is not relative. This is the recommended default for most applications.
trueFull isolation — behaves like a fully isolated Rails engine (isolate_namespace in the engine). Models, helpers, routes, and URL helpers are all scoped.
falseNo isolation — the admin module is defined in the parent namespace with no isolation at all.
# Full Rails engine isolation
config.isolate_namespace = true

base_controller

base_controller
String
default:"'ApplicationController'"
The name of the host application controller that the admin engine’s own TAController will inherit from.Provide a string (not the constant itself) to avoid triggering an eager load of the constant before the application has fully booted. This is the primary way to inherit authentication, before_action hooks, and concerns you have already set up in your main app.
config.base_controller = 'Admin::BaseApplicationController'

default_authenticated

default_authenticated
Boolean
default:"true"
Whether every admin route requires authentication unless explicitly marked otherwise.When true, all routes generated inside the admin engine inherit authenticated: true in their annotations. Individual route scopes can override this with unauthenticated { ... } in your route definitions. Set to false to make all routes public by default — useful during development, but not recommended for production.
config.default_authenticated = false

theme

theme
String
default:"'tailwind'"
The CSS framework theme used to render admin UI components.Accepted values: 'tailwind', 'bootstrap', 'bulma', 'semantic_ui'.Each value maps to a corresponding helpers module (Elements::Helpers::Bootstrap, ::Bulma, ::SemanticUI) that defines all component primitives via the Elements DSL. You must include the chosen framework’s CSS yourself in your application layout.
config.theme = 'semantic_ui'

theme_extensions

theme_extensions
Array<Proc | Module | String>
default:"[]"
A list of extensions to apply on top of the base theme’s UiBuilder class.Each entry may be:
  • A Proc — executed in the context of the UiBuilder class, allowing you to call define, associate, and other DSL methods directly.
  • A Module — included into the UiBuilder class so you can override or add helper methods.
  • A String — a module name that will be constantized and then included.
Extensions are applied in array order, so later entries can override earlier ones.
config.theme_extensions = [
  MyAdmin::ThemeOverrides,   # Module
  proc { define(:my_widget) { |b| b.preset(:default, as: 'div') } }, # Proc (instance_exec, no arg)
  'MyAdmin::ExtraHelpers',   # String (constantized at boot)
]

elements_lookup_context

elements_lookup_context
Array<String>
default:"['Object', 'Torque::Admin']"
An ordered list of module name strings that are searched when resolving element helpers (e.g. custom define-d components).The lookup happens in reverse order — the last module in the array is checked first. Torque Admin automatically appends the admin application’s own module to this list at initialization, so your app-level elements always take precedence over the built-in ones.
config.elements_lookup_context = ['Object', 'Torque::Admin', 'MyApp::AdminElements']

resources.default_strict_loading

resources.default_strict_loading
Boolean
default:"false"
Whether ActiveRecord strict loading is enabled by default for all resources managed by the admin application.Strict loading raises an error when an association is accessed without being eagerly loaded, helping you catch N+1 queries during development. Set to true to enable it globally; you can still opt individual resources out.
config.resources.default_strict_loading = true

Complete Configuration Example

The following shows all options together in a typical initializer:
# config/initializers/torque_admin.rb

Torque::Admin.configure do |config|
  # Branding
  config.title = "Acme Admin"

  # Namespace
  config.parent_module = 'Object'
  config.isolate_namespace = nil   # hybrid (default)

  # Controllers
  config.base_controller = 'ApplicationController'

  # Routing & auth
  config.root_path = nil           # read from mount call
  config.default_authenticated = true

  # Performance
  config.stream_actions = true
  config.parallel_processing_with = :concurrent_ruby

  # UI
  config.theme = 'semantic_ui'
  config.theme_extensions = [MyAdmin::ThemeOverrides]
  config.elements_lookup_context = ['Object', 'Torque::Admin']

  # Resources
  config.resources.default_strict_loading = false
end
For a named application (e.g. a separate staff portal):
Torque::Admin[:staff].configure do |config|
  config.title  = "Staff Portal"
  config.theme  = 'bootstrap'
  config.parent_module = 'Staff'
end

Build docs developers (and LLMs) love