Skip to main content

DSL Reference

Every method you can call inside a cm_admin block, grouped by where it applies. Each method links to the page that documents it with examples.

cm_admin block​

Model-level settings, declared once per model. See Views and Configuration.

MethodWhat it does
actionsEnables or disables the built-in CRUD actions (only: / except:).
icon_nameSidebar icon for the model. See Views.
display_nameLabel shown in the sidebar and page headers.
visible_on_sidebarHides the model from the sidebar while keeping its pages reachable.
comments_tabAdds a comments tab to the show page. See Comments & Mentions.
policy_scopesNarrows the records a role can see. See Roles & Permissions.
default_scopesModel scopes applied to every action.
override_policyUses a custom Pundit policy. See Roles & Permissions.
additional_permitted_fieldsExtra params permitted on create/update beyond the declared form_fields.
global_search_fieldsColumns searched by global search. See Global search.
mcp_actionsExposes list/get/aggregate (and opt-in create/update) over MCP. See MCP server.
importableEnables CSV import. See Importers.
descriptionInternal description of the model config.

Pages​

Each method declares one admin page. See Views.

MethodPage
cm_indexIndex page β€” table, card or kanban listing.
cm_showShow page β€” record detail with tabs.
cm_newNew page β€” create form.
cm_editEdit page β€” update form.
cm_destroyDestroy β€” delete confirmation.
cm_dashboardDashboards β€” metric cards, charts and tables.

Page layout​

Used inside a page block to structure its content. See Page header & layout, Tabs, Rows and Sections.

MethodWhat it does
page_titleTitle shown at the top of the page.
page_descriptionText (HTML allowed) below the title.
title_iconIcon next to the page title, with optional link and tooltip.
tabA tab on a show page, including association tabs (has_many / has_one). See Tabs.
rowLays sections out in a row (for side-by-side content). See Rows.
cm_sectionA titled section holding fields. See Sections.
cm_show_sectionDeprecated alias of cm_section.
nested_form_sectionA cm_section nested inside another section. See Sections.
stepA step inside a form or progressive form. See Progressive forms.
alert_boxA callout box on the page. See Alerts.

Listing options​

Used inside cm_index. See Index page.

MethodWhat it does
columnA table column. See Columns.
all_db_columnsAdds a column for every database column.
filterA filter (search, select, range, date). See Filters.
sortA sortable column. See Sorting.
scope_listModel scopes applied to this listing only.
kanban_viewRenders the listing as a kanban board grouped by a column.
eager_load_associationsAssociations to preload to avoid N+1 queries.

Fields​

Used inside cm_section, tab, step and forms. See Fields and Form fields.

MethodWhat it does
fieldRenders an attribute on a show page. See Show fields.
form_fieldRenders a form input. See Form fields.
nested_form_fieldEdits or lists a has_many association inline. See Nested form fields.

Actions​

Used inside a page block or the cm_admin block. See Actions.

MethodWhat it does
custom_actionA button, modal, form or page action. See Custom actions.
bulk_actionAn action run on selected records. See Bulk actions.
action_groupGroups actions under one dropdown. See Group actions.