1

In user update page, there is a password field which is added to the form with attr_accessor:

attr_accessor :password, :password_confirmation

The view code for those 2 fields in _form.html.erb is :

  <div id='div_user_password'>
  <%= f.input :password, :label => t('Password'), :hint => t('6 characters or more')  %>
  <%= f.input :password_confirmation, :label => t('Password Confirmation') %>
  </div>

The erb code had no problem before. After removing a few fields (no change for password and password_confirmation though) from the _form.html.erb, however, the text box for password disappeared (see attached below). The html source for the password is:

<label class="password optional control-label" for="user_password">
<span class="translation_missing" title="translation missing: EN.Password">Password</span>
</label>

There is missing <input id = ....> for the password in the html source code. What could cause the missing of the text box for password? If we rename field to password_new from password, then the text box shows up. Is it a bug of simple_form (version 2.1.1)? We use bootstrap.

enter image description here

1
  • After deleting a jquery.min file under public/assets/, the page starts acting normally. The old assets seems to be the problem.
    – user938363
    Dec 21, 2013 at 15:59

1 Answer 1

1

Please using attr_accessible instead.

4
  • Password has been added to attr_accessible since the beginning. Password is not a column in our db table and is only a field on the form.
    – user938363
    Dec 20, 2013 at 2:26
  • Same after removing password from attr_accessor
    – user938363
    Dec 20, 2013 at 2:34
  • @user938363 And what the exact simple_form version you used? Dec 20, 2013 at 2:47
  • simple for version 2.1.1
    – user938363
    Dec 20, 2013 at 3:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.