Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Forms 将输入_用于@conn_Forms_Elixir_Phoenix Framework - Fatal编程技术网

Forms 将输入_用于@conn

Forms 将输入_用于@conn,forms,elixir,phoenix-framework,Forms,Elixir,Phoenix Framework,我正在尝试创建这样一个表单: <%= form_for @form_object, registration_path(@conn, :register), [class: "register_form"], fn f -> %> <div class="register_alert"> <%= Web.PartialView.render("flash_alert.html", conn: @conn) %> <

我正在尝试创建这样一个表单:

 <%= form_for @form_object, registration_path(@conn, :register), [class: "register_form"], fn f -> %>
    <div class="register_alert">
      <%= Web.PartialView.render("flash_alert.html", conn: @conn) %>
      <%= inputs_for f, :user, [default: %{name_first: nil}], fn fu -> %>
        <%= label fu, :name_first, "FIRST NAME", class: "register_label" %>
        <%= text_input fu, :name_first, class: "register_text-field"%>
      <% end %>
      <%= submit "Sign Up", class: "register_register-button" %>
    </div>
  <%end%>
%>
%>
@form\u对象
是一个最初传入的
conn
,因为在他们输入数据(创建表单)之前,我没有变更集。然而,当我尝试运行这个程序时,我不断得到非常有用的“参数错误”崩溃。如果我删除部分的输入,一切都很好。在phoenix中,如何将输入_用于连接对象

正在使用Phoenix 1.4.0。

是一个
结构,几乎包含了连接的所有内容

接受连接对象作为第一个参数

由于您甚至没有Phoenix提供有关错误消息的任何信息,因此我建议问题的形式是
@form\u object
。显然,您手头有
@conn
对象,将其作为第一个参数传递:

<%= form_for @conn, registration_path(@conn, :register) ...

我声明form\u对象是conn,而form\u for不是问题所在。的输入_是问题所在,如上所述。我犯的错误就是凤凰城给我的错误。同样如上所述,问题是如何使用conn对象的输入。这些都不能回答这个问题。如果您希望收到任何帮助,请共享您收到的完整错误消息。我们不是算命师。问题是:如何使用Plug.Conn对象的输入。你有这样的例子吗?因为我试过的东西都不管用,而你提供的是表单,不是输入。