-> Reloadable
The reloadable option adds a reload icon next to the association title so users can easily reload just that turbo-frame instead of doing a full page reload.
Usage
To enable the reloadable feature, you have two options:
- Direct Boolean Value:
Provide a boolean value directly to the reloadable option. This sets a default behavior where the reloadable feature is either enabled or disabled based on this boolean value.
field :reviews, as: :, reloadable: true- Dynamic Conditions with a Block:
For more dynamic behavior, you can provide a block to the reloadable option. Within this block, you can specify conditions under which the reloadable should be displayed.
field :reviews, as: :,
reloadable: -> {
current_user.is_admin?
}In the above example, the reloadable will be visible if the current_user is an admin.
ExecutionContext
The reloadable block executes within the ExecutionContext, granting access to all default methods and attributes.
