PhoenixHelpers.Plug.QueryParser (phoenix_helpers v0.8.0) View Source

A Plug for parsing include, filter, page and q.

To use it, add it to your controller.

plug PhoenixHelpers.Plug.QueryParser,
  include: ~w(posts comments)
  filter: ~w(name)

The plug will add a PhoenixHelpers.Query struct called phoenix_helper_query to your conn.assigns

Options

  • include - list or map by action of a available includes. Default is [].
  • filter - list a available filter. Default is [].
  • default_page_number

Link to this section Summary

Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Link to this section Functions

Specs

call(Plug.Conn.t(), any()) :: Plug.Conn.t()

Callback implementation for Plug.call/2.

Specs

Callback implementation for Plug.init/1.