In the Phoenix framework
def show(conn, %{"id" => id}) do
json conn, Repo.get(User, id)
end
matches fine, but using the : notation does not pattern match
def show(conn, %{"id": id}) do
json conn, Repo.get(User, id)
end
when I call the following code from a test
conn
|> get(user_path(conn, :show, user.id))
|> json_response(200)