Writing my first phoenix app…
Want to display a list of ‘tags’ in page/index.html
In Rails it would be:
@tags=Tag.all
How do I get this in Phoenix?
Any alias needed?
page_controller
defmodule MyappWeb.PageController do
use MyappWeb, :controller
///? alias Myapp.Projects.Tag
def index(conn, _params) do
tags = Repo.all(Tag)
render(conn, "index.html", tags: tags)
end
My tags model is under lib/myapp/projects/projects.ex
I cant find anything on google.
Thanks for support.