标签: ruby-on-rails forms text input default
嘿我试图在输入框中设置默认值:
<div class="field"> <%= f.email_field :email, autofocus: true, value: 'email' %> </div>
我想让电子邮件文本消失,然后当用户点击输入框时,文本就会被删除。
答案 0 :(得分:0)
您只需添加占位符
f.email_field :email, autofocus: true, placeholder: "email"