我正在使用foundation-rails并创建一个注册表单。
这就是我用来在div中创建密码字段的内容。
<%= text_field_tag "password", "", placeholder: "Password", required: true, type: "password" %>
<small class="error">Invalid</small>
对于确认密码字段,我在div中设置类似:
<%= text_field_tag "password_confirmation", "", placeholder: "Reenter password" , required: true, type: "password" %>
<small class="error >Invalid</small>
我想使用基础data-equalto="password"
进行密码确认,以确保输入相同的密码。但我无法将其添加到Rails(它不起作用)。
任何帮助?
答案 0 :(得分:1)
您可以添加所需的任何HTML选项:
<%= text_field_tag "password", "", placeholder: "Password", required: true, type: "password", data: { equalto: "browser" } %>