For the complete documentation index, see llms.txt. This page is also available as Markdown.

πŸ”§Util & Helpers

We have two files to put helper functions:

  • Util (/lib/util.ex) - utility functions used anywhere, eg. random_string()

  • PetalProWeb.Helpers (lib/petal_pro_web/helpers.ex)- utilities functions imported into views (templates and live views), eg. main_menu_items(), is_admin?

If you want to add new helpers, ask "is this only going to be used in templates and live views?". If yes then put it in helpers.ex. If "no", put it in util.ex.

Was this helpful?