今天我用凤凰框架创建一个新项目,添加一个单独的功能.我现在的问题是我不知道如何创建和验证确认字段,例如用户密码.我没有找到这个主题的任何内容.
在我目前的代码下面,没什么特别的
我目前的表单模板
<%= form_for @changeset, @action, fn f -> %>
    <%= if f.errors != [] do %>
        <!-- not interesting -->
    <% end %>
    <div class="form-group">
        <%= label f, :username, "User name" %>
        <%= text_input f, :username, class: "form-control" %>
    </div>
    <div class="form-group">
        <%= label f, :password, "Password" %>
        <%= password_input f, :password, class: "form-control" %>
    </div>
    <!-- How to validate this??? -->
    <div class="form-group">
        <%= label f, :password_confirmation, "Password confirmation" %>
        <%= password_input f, :password_confirmation, class: "form-control" %> …Run Code Online (Sandbox Code Playgroud) 我正在使用PhoenixFramework和图书馆毒药.目前我正在开发REST API.现在我需要以Book两种不同的方式对模型进行编码.
GET /books)GET /book/1)GET /books
{
  "books": [
    {
      "id": 1,
      "name": "Book one"
    },
    {
      "id": 2,
      "name": "Book two"
    },
    // ...
  ]
}
Run Code Online (Sandbox Code Playgroud)
GET /books/1
{
  "book": {
     "id": 1,
     "name": "Book one",
     "description": "This is book one.",
     "author": "Max Mustermann",
    // ...
  }
}
Run Code Online (Sandbox Code Playgroud)
编码器 Book
defimpl Poison.Encoder, for: MyProject.Book do
  @attributes [:id, :name, :description, :author]
  def encode(project, _options) do
    project
    |> Map.take(@attributes)
    |> Poison.encode! …Run Code Online (Sandbox Code Playgroud) 我正在 JBoss 服务器上使用 camunda 引擎。如果部署了新的(版本)BPMN 图,我会搜索一种执行自定义代码的方法。
我想要的是:
是否存在一个侦听器或类似的东西,如果检测到新的部署,将执行该侦听器?
感谢帮助!