ReBa
ReBa

Reputation: 1568

How to set a blank input form?

I want to create a form where a user is able to update his/her email and password.

<%= form_for @customer do |c| %>
    <%= c.label :email%>
    <%= c.text_field :email%>
    <%= c.label :email_confirmation %>
    <%= c.text_field :email_confirmation%>
    <%= c.label :password%>
    <%= c.password_field :password%>
    <%= c.label :password_confirmation%>
    <%= c.password_field :password_confirmation%>
    <%= c.submit("Edit profile")%>
<% end %>

The problem is that I don't want them to be filled in when just looking at it. So it should have something like:

Email [blank]
Email confirmation [blank]
Password [blank]
Password confirmation [blank]

So how do I have this to be blank in stead of pre-filled in by Rails?

Thanks in advance!

Upvotes: 1

Views: 554

Answers (1)

simonmenke
simonmenke

Reputation: 2880

Pass an empty value:

<%= c.text_field :email, :value => "" %>

Upvotes: 1

Related Questions