I use Tailwind CSS 2.0 in a Phoenix application. The error_tag in a form gives me a headache:
<div>
<label for="password" class="block text-sm font-medium text-gray-700">
Passwort
</label>
<div class="mt-1">
<%= password_input f, :password, required: true, id: "password", type: "password",
autocomplete: "new-password",
class: "appearance-none block w-full px-3 py-2 border border-gray-300 rounded-md
shadow-sm placeholder-gray-400 focus:outline-none focus:ring-indigo-500
focus:border-indigo-500 sm:text-sm"
%>
<p class="mt-2 text-sm text-gray-500"><%= error_tag f, :password %></p>
</div>
</div>
Which results in this HTML:
<p class="mt-2 text-sm text-gray-500">
<span class="invalid-feedback" phx-feedback-for="user_password">
should be at least 8 character(s)
</span>
</p>
and this rendering:
Question: Can I force error_tag not to render the <span>, use a different class or can I access the error message without the error_tag?
I tried to solve this by googling error_tag and class but that didn't result into any helpful article.
