Menu icon Foundation
ERB and data-abide

How can I add the data-abide to an erb form?

abidevalidationrailserb

How can I add the data-abide to an erb form?

Paul Lazaga over 5 years ago

Something like this: <%= form_for(@profile, data: {abide: ''}) do |f| %>

Then this: <%= f.text_field :first_name, placeholder: 'First Name', required: '' %>

Paul Lazaga over 5 years ago

Oh and to call the error message:

<%= content_tag(:small, "This field is required", class: "error") %>