CastParams v0.0.1 CastParams View Source

Plug for casting request params to defined types.

Usage

defmodule AccountController do
  cast_params [category_id: :integer, terms: :boolean!] when action == :show

  # support namespace
  cast_params [user: [category_id: :integer, terms: :boolean!]] when action == :user

  
  def show(conn, %{category_id: category_id, terms: terms}) do
    
  end
end

Link to this section Summary

Link to this section Functions

Link to this macro cast_params(options) View Source (macro)