开发者

Rails: how can I force no value for a form_for text field for a model that has that field populated?

开发者 https://www.devze.com 2023-02-12 19:51 出处:网络
I have this form: =form_for @current_user, :url => update_password_path do |f| %label{:for => \"\"} * New Password

I have this form:

=form_for @current_user, :url => update_password_path do |f|
    %label{:for => ""} * New Password
    =f.password_field :password, :value => ""

But when the开发者_开发知识库 current user has a password, this field is populated on the page despite the :value => ""

How can I force this field blank on the page and still use form_for?


password_field_tag "user[password]", ""
0

精彩评论

暂无评论...
验证码 换一张
取 消