Home

Awesome

ecto_list

Ecto_list is a simple library that helps you manage ordered model with Ecto.

ecto_list

Description

Let's take an example of an ordered model: a Serie which contains an ordered list of videos.

Instead of storing the position of each video in the videos themselves, we will store the ordering in the serie and we will call EctoList.ordered_items_list/2 to return for us the list of items properly ordered.

Installation

Read the tutorial to understand the process of installation of the library.

Functions available

In EctoList.ListItem, you have a set of functions to modify the ordering of your order list. The API is inspired by acts_as_list Ruby gem.

Functions That Change Position and Reorder List

Methods That Return Data of the Item's List Position

Demo

See the demo here.

Documentation

The documentation can be found here: https://hexdocs.pm/ecto_list.

Contributing

Feel free to open an issue or a PR if you want to add a new feature. 😁