I’m trying to use scrivener but I’m having some issues understanding the correct way to use it. I also tried rummage and had the same issue.
My current code
alias Magnify.Magnets
alias Magnify.Magnets.Magnet
def index(conn, _params) do
magnets = Magnets.list_magnets()
render(conn, "index.html", magnets: magnets)
end
And when I try to add scrivener
def index(conn, _params) do
magnets = Magnify.Magnets
|> Magnify.Repo.paginate(_params)
render conn, "index.html", magnets: magnets
end
Getting the following error
function MagnifyWeb.MagnetController.init/1 is undefined (module MagnifyWeb.MagnetController is not available)
alias Magnify.Magnets
alias Magnify.Magnets.Magnet
I tried adding the alias you suggested and I got the following error
protocol Ecto.Queryable not implemented for Magnify.Magnets, the given module does not provide a schema. This protocol is implemented for: Atom, BitString, Ecto.Query, Ecto.SubQuery, Tuple
and when I did Magnify.Repo.paginate I get the same error