sakshik12 sakshik12 - 1 year ago 87
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
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 Source

You can add any HTML option you need:

<%= text_field_tag "password", "", placeholder: "Password", required: true, type: "password", data: { equalto: "browser" } %>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download