What it does
avo-record_reordering
Let your team put records in the right order (carousel slides, menu items,
ranked lists) straight from your resource
Index view.
Set
self.ordering
on a resource and Avo adds move higher, move lower, move to top, and move to
bottom controls, with optional drag-and-drop, all backed by a position
column you already have.
Each action is a lambda you wire to your own model, so it works with
acts_as_list
methods like move_higher
and insert_at,
or any positioning logic you write. Choose where the controls show up with
visible_on,
keep them inline or tucked in a popover, and gate the whole thing behind a
reorder?
policy. That's reordering UI your agent configures in a few lines, on a
foundation that keeps improving with Avo.
What you get
- Move higher, move lower, move to top, and move to bottom controls on the index
-
Drag-and-drop reordering with
drag_and_drop: trueand aninsert_ataction -
Per-action lambdas that call your model, designed to pair with
acts_as_list -
Controls on the index, in associations, or both via
visible_on -
Inline buttons or a popover, switched with
display_inline -
Custom position attribute through a
positionlambda (defaults torecord.position) -
Safe by default: gate who can reorder with a
reorder?policy method
Why it pays off
-
Add a position column, set
self.ordering, and ship reordering this afternoon. The buttons, drag-and-drop, and controller wiring are otherwise a sprint. - Every Avo release makes it better: drag-and-drop and its position updates, the kind of UI that breaks quietly, keep working through upgrades, and fixes reach your app with bundle update.
-
It hooks into
acts_as_listand your own position logic, so you keep your data model and your agent skips generating a one-off reordering tool in every app.