Skip to content

Commit 533a657

Browse files
committed
fix: Update to the new form syntax
1 parent f73ce25 commit 533a657

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

lib/brasil_em_dados_web/live/admin/posts_live/new.html.heex

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="container mx-auto px-6">
22
<h2 class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200">Novo Post</h2>
3-
<%= f = form_for @changeset, "#",
4-
id: "post-form",
5-
phx_change: "validate",
6-
phx_submit: "save" %>
3+
<.form let={f} for={@changeset},
4+
id="post-form",
5+
phx_change="validate",
6+
phx_submit="save" >
77

88
<%= label f, :title, "Titulo", class: "mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300" %>
99
<%= text_input f, :title, class: "block w-full mt-1 mb-4 text-lg dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input border-b border-gray-300" %>
@@ -20,4 +20,5 @@
2020
<%= error_tag f, :body %>
2121

2222
<%= submit("Salvar", phx_disable_with: "Salvando...", class: "font-bold mt-10 index-1 sm:ml-4 px-8 py-3 sm:py-2 rounded bg-purple-700 text-gray-100 hover:bg-purple-900 transition duration-300 text-center") %>
23+
</.form>
2324
</div>
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div class="container mx-auto px-6">
22
<h2 class="my-6 text-2xl font-semibold text-gray-700 dark:text-gray-200">Nova Tag</h2>
3-
<%= f = form_for @changeset, "#",
4-
id: "tag-form",
5-
phx_change: "validate",
6-
phx_submit: "save" %>
3+
<.form let={f} for={@changeset},
4+
id="tag-form",
5+
phx_change="validate",
6+
phx_submit="save">
77

88
<%= label f, :name, "Nome", class: "mb-4 text-lg font-semibold text-gray-600 dark:text-gray-300" %>
99
<%= text_input f, :name, class: "block w-full mt-1 mb-4 text-lg dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:text-gray-300 dark:focus:shadow-outline-gray form-input border-b border-gray-300" %>
@@ -14,4 +14,5 @@
1414
<%= error_tag f, :color %>
1515

1616
<%= submit("Salvar", phx_disable_with: "Salvando...", class: "font-bold mt-10 index-1 sm:ml-4 px-8 py-3 sm:py-2 rounded bg-purple-700 text-gray-100 hover:bg-purple-900 transition duration-300 text-center") %>
17+
</.form>
1718
</div>

0 commit comments

Comments
 (0)