Announcing ActiveScaffold Config List 4.1: Custom Views and UI Adapters
ActiveScaffold Config List 4.1 is now available. This release makes named views more flexible with custom list partials, default view selection, and tooltips, while adopting the UI elements API introduced in ActiveScaffold 4.4.
Render a named view with its own partial
Named views are no longer limited to changing columns and sorting. A view can now render a custom partial, making it possible to present the same records as a compact list, calendar, cards, or another application-specific layout:
config.config_list.add_view :calendar do |view|
view.label = "Calendar"
view.view = "calendar_list"
endThe partial receives the same assigns and helpers as the standard ActiveScaffold list. Views that use a custom partial do not need to define columns, although they may still do so when the partial uses the configured list columns.
Choose the initial named view
A controller can now select a named view when the request does not specify one:
config.config_list.default_view = :calendarAn explicit empty config_list_view continues to select the ordinary configurable list, so users can still return to it from the view selector.
Applications can also control whether that ordinary, unnamed view appears in the selector:
config.config_list.unnamed_view_security_method = :unnamed_list_view_authorized?The configured controller method determines whether the choice is visible. Authorization for the underlying list action should still be enforced separately.
Add context with view tooltips
Controller-defined named views can include a tooltip. It is exposed consistently by the links, radio-button, and select-field selectors:
config.config_list.add_view :pending do |view|
view.label = "Pending review"
view.tooltip = "Records that still require approval"
view.columns = [:name, :submitted_at, :reviewer]
endStyle Config List with a UI framework adapter
Config List 4.1 uses ActiveScaffold 4.4’s UI elements API throughout its view selector and configuration form. Bootstrap, Tailwind CSS, and other adapters can now customize tags and attributes without replacing the plugin’s templates.
For example, an adapter can style the selector controls with the same registry used by ActiveScaffold itself:
ActiveScaffold.add_element_attributes :config_list_view_link,
class: "dropdown-item"
ActiveScaffold.add_element_attributes :config_list_view_select,
class: "form-select"
ActiveScaffold.add_element_attributes :config_list_view_radio,
class: "form-check-input"The columns list, sorting controls, view-name field, and global and rename options also expose named UI elements for adapter customization.
Fixes and compatibility improvements
This release also:
- Prevents
config_list_viewfrom leaking into nested ActiveScaffold links. - Keeps a selected named view available while rendering a custom list partial.
- Fixes Config List helpers when the plugin is installed but a controller does not enable the
config_listaction. - Corrects configuration-form parameters and the reset URL for the ActiveScaffold 4.4 form helpers.
Upgrade
ActiveScaffold Config List 4.1 requires ActiveScaffold 4.4.0 or newer. Update your Gemfile:
gem "active_scaffold", "~> 4.4.0"
gem "active_scaffold_config_list", "~> 4.1"Then run:
bundle update active_scaffold active_scaffold_config_listRead the named views tutorial for the complete setup, or visit the ActiveScaffold Config List plugin page.
🚀 Happy scaffolding with ActiveScaffold!
