Masu.Views.Ecto (Masu v0.1.0)

Copy Markdown View Source

Views in a table of your database (see Masu.Views).

defmodule MyApp.GridViews do
  use Masu.Views.Ecto, repo: MyApp.Repo
end

<.data_grid id="orders" ... views={MyApp.GridViews} user={@user}>

mix masu.gen.views writes the migration of the table, masu_views. Options of use: repo (required), and table, for a table of another name.

A person's last view and their named views are rows of the table: a row of grid (the grid's views_key), owner (the user's id), name (nil for the last view), shared and params (a map).