Module: Plutonium::UI::Component::Positionable

Included in:
Grid::Resource, Table::Resource
Defined in:
lib/plutonium/ui/component/positionable.rb

Overview

Drag-to-reorder plumbing shared by every index surface that renders a collection of a position_on resource — the table (Table::Resource) and the card grid (Grid::Resource).

Extracted rather than copied because the two halves of this feature have to agree EXACTLY: the client only offers a drag under the same condition the server accepts one, and the URL template the client substitutes into has to be the collection's own path. Two copies of that reasoning is two places for the client and the server to drift apart.

A host must supply resource_definition, current_query_object, current_page_path and policy_for — everything Component::Base's index views already have.