Plucto v0.1.0 Plucto View Source
Plucto is a light wieght unobtrusive pagination helper for elixir/phoenix web applications. Plucto does not "integrate" with existing schemas, it is simply library for asbtracting common pagination functions. Plucto is intended to work with Plug and Ecto. It requires a conn struct, ecto query, and ecto repo.
You might be familiar with generated context functions such as this: %User{} |> Repo.all()
To write this using Plucto you would do: from(u in User) |> Plucto.flip(conn, Repo)
Why the conn struct? Plucto at this time is a configuration free library. It gets all the informaion it needs using the url. The only two parameter that matter are page and limit. Neither are required to initial a paginated response. Plucto will default to page 1 and a limit of 25.
Consider a page that list users, we will use the url www.officeadmin.com/users www.officeadmin.com/users is a paginatable route due to the defaults. www.officeadmin.com/users is the same as this www.officeadmin.com/users?page=1