elixir - How to write a query for a shared/footer.html.eex? -
i have shared footer show display on pages, almost. want display information database in it. instead of querying in each action of webapplication accross controller , passing via assigns in each action in each controller, there way query once in kind of action footer?
you may want consider creating controller plug allow assign footer information in number of controllers , actions. have following in controllers.
plug :assign_footer when action in [:index, :show, :edit]
Comments
Post a Comment