ForageWeb.ForageView.forage_select

You're seeing just the function forage_select, go back to ForageWeb.ForageView module for more information.
Link to this function

forage_select(form, field, path, opts \\ [])

Widget to select multiple external resources using the Javascript Select2 widget.

Parameters:

  • form (t:Phoenix.Html.Form.t/0)- the form
  • field (atom)
  • path - the URL from which to request the data

Options:

  • :foreign_key (optional) - The name of the foreign key (as a string or an atom). If this is not supplied it will default to field_id

You'll probably want to use it inside a forage_form_group.

Examples

<%= forage_form_group(f, :function,
        dgettext("your_app", "Function"),
        fn form, field, opts ->
          forage_select(form, field, Routes.backoffice_function_path(@conn, :select), opts)
        end) %>