phoenix-framework

    2熱度

    3回答

    後 iex -S mix phx.server 我想要做的IEX終端的一些快速測試,但有些功能需要的結構%Plug.Conn {}作爲參數,例如我想獲得表達式的結果: MyAppWeb.Router.Helpers.confirmation_url(%Plug.Conn{}, :edit, "12345") 但我有錯誤: Phoenix endpoint not found in %{}

    0熱度

    1回答

    我想通知有關在我的模型上創建/更新/刪除事件的渠道。 例如: defmodule PhoenixLibrary.Books do def delete_book(%Book{} = book) do PhoenixLibrary.Endpoint.broadcast("books:updates", "delete", %{id: book.id}) Repo.del

    2熱度

    1回答

    我需要在HTML頁面中列出很多項目。在合理範圍內一次顯示的項目太多。我曾見過與Ecto一起使用的工具來處理EEX模板中的尋呼機。但是,在我的控制器中,我從外部數據源提取這些數據,並且無法用Ecto查詢它。下面的模板文件inventory.html.eex。 <div class="section-content"> <div class="section-row"> <

    0熱度

    1回答

    我有一個application.ex,看起來像這樣: defmodule Qtrain.Application do use Application def start(_type, _args) do import Supervisor.Spec children = [ supervisor(QtrainWeb.Endpoint, [],

    0熱度

    2回答

    我是Elixir的新手,想知道是否有方法檢查字符串是否爲日期而不必編寫自己的使用正則表達式的函數?

    0熱度

    1回答

    我試圖發送JSON,當路徑不匹配。從error_view.ex,我的事情錯誤第一命中: def template_not_found(_template, assigns) do render "404.html", assigns end ,但如果我將其更改爲: def template_not_found(_template, assigns) do %{messag

    0熱度

    1回答

    我正在考慮遷移我的仙丹/鳳凰城項目的測試從ExUnit到espec_phoenix。 當我在運行測試之前建立了一個測試數據庫時,它按預期工作。 但是,當我不這樣做,我得到一個錯誤: 12:04:27.581 [error] Postgrex.Protocol (#PID<0.433.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (in

    0熱度

    1回答

    我正在使用Floki解析一些HTML。並接收到以下元組: {"html", [{"lang", "en"}], [{"head", [], [{"title", [], ["My App"]}, {"link", [{"rel", "stylesheet"}, {"href", "/css/app.css"}], []}]}, {"body", [], [

    3熱度

    1回答

    我正在使用System.cmd命令來處理文件。但是,如果系統上找不到文件,則會提高,特別是Erlang error: :enoent。 如何使用case功能處理此錯誤?這是我到目前爲止的代碼: case System.cmd(generate_executable(settings), ["start"]) do {output, 0} -> IO.inspect("Start

    1熱度

    1回答

    我有了這個功能: def run(id) do {_, status} = System.cmd "osascript", ["#{File.cwd!}/lib/script/test.applescript"], arg0: id {:ok, status} end 我需要傳遞給idosascript。等效殼牌號爲:osascript ~/lib/script/test