๐ BIG NEWS ๐ โฆ Avo 4 has officially SHIPPED โฆ ๐ the beta is over, 4.0 is here โฆ ๐ ๏ธ build admin panels, dashboards & internal tools at light speed โฆ โญ you are visitor #1,136,979 โฆ ๐ tell a friend โฆ best viewed in Ruby on Rails โฆ ๐ click here to see what’s new โฆ
Record Reordering
Arrange content and prioritize items with simple drag-and-drop. Ideal for content management and priority lists.
# $15/mo
gem "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 you configure in a few lines instead of building
and maintaining yourself.
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, without you patching it.
-
It hooks into
acts_as_listand your own position logic, so you keep your data model and skip the one-off reordering tool you would otherwise own and support.
# included in
# ready to ship?
You ship it this afternoon. We keep it solid for years.