x
1
2
3
4
5
6
7
8
<div id="association-overlay-a2f8c39196d7e1ebc1a3" class="lui-association-overlay"> <div class="lui-association-overlay__divider"></div> <div class="lui-association-overlay__search"> <i class="fa-regular fa-search text-[8px] font-bold"></i> <input type="text" placeholder="Search or text for new" data-model-association-overlay-target="input"> </div> <div class="lui-association-overlay__divider"></div></div>No Usage documentation to display.
1
<%= render LooposUi::AssociationOverlay.new(can_search: params[:can_search]) %>No notes provided.
| Param | Description | Input |
|---|---|---|
|
Show search |
|
Description
The ModelAssociationOverlay component provides an interface for managing associations between models. It displays currently attached items and allows users to add or remove associations through a searchable overlay interface.
Arguments
| Property | Default | Description |
|---|---|---|
model |
Required | The ActiveRecord model instance that owns the associations |
association |
Required | The name of the association to manage |
component_class |
LooposUi::TagToken |
The component class used to render individual items |
association_scope |
nil |
Optional scope to apply to the association query |
can_search |
true |
Whether to show the search component |
can_create_new |
true |
Whether to allow creation of new association items |
header_icon |
nil |
Optional icon to display in the overlay header |
header_title |
nil |
Optional title to display in the overlay header |
Features
- Displays currently attached items with remove capability
- Shows available items that can be attached
- Searchable interface for finding items
- Optional ability to create new items
- Supports both TagToken and Entity component types
- Automatic header generation for Entity components
Example Usage
Basic usage with tag tokens: