Fill current date in the "form" automatically?

I currently have an application (phoenix 1.3) running perfectly …
With a field filled with date manually.

I needed this field filled in automatically, with the current date.
And show on form.html

How would do that?

form.html

  <div class="form-group">
    <%= label f, :emissao_pedidos, class: "control-label" %>
    <%= text_input f, :emissao_pedidos, class: "form-control" %>
    <%= error_tag f, :emissao_pedidos %>
  </div>

Controller…

  def new(conn, _params) do
    changeset = Account.change_pedido(%Pedido{})
...
     render(conn, "new.html", changeset: changeset)

  end

You could put the result of something like Date.utc_today() into you plug assigns and just render it on your template.

1 Like

Thank you…
I was able to solve with javascript
Even so, thank you for the response.