sakshik12 sakshik12 - 3 months ago 18
Ruby Question

signup form -- Rails + foundation

Im using foundation-rails and creating a signup form.

This is what Im using to create a password field in a div.

<%= text_field_tag "password", "", placeholder: "Password", required: true, type: "password" %>
<small class="error">Invalid</small>


For the confirm password field, I am setting it up similarly, in a div:

<%= text_field_tag "password_confirmation", "", placeholder: "Reenter password" , required: true, type: "password" %>
<small class="error >Invalid</small>


I want to use foundation's
data-equalto="password"
for the password confirmation to make sure the same password is entered. But Im unable to add it to Rails(it does not work).

any help ?

Answer

You can add any HTML option you need:

<%= text_field_tag "password", "", placeholder: "Password", required: true, type: "password", data: { equalto: "browser" } %>
Comments