Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9210445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:04:46+00:00 2026-06-18T01:04:46+00:00

I have a site on PHP which I want to convert to Rails. I

  • 0

I have a site on PHP which I want to convert to Rails. I use md5 for password storage and _form partial for registration and edit users data. I made login and password fields required, thats work perfect for registration but when user try to edit his data, something like login, password field again need to fill (password field has password type and stay blank for editing). How I can use those form and solve problem with password enter in edit mode ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:04:48+00:00Added an answer on June 18, 2026 at 1:04 am

    In your model, add a validation on your password fields only if they’ve been filled in, in other words, on update, the fields can be blank. If they are blank, then they will not be validated or changed.

    validates :password, 
              :confirmation => true, 
              :length => {:within => 8..20}, 
              :allow_blank => true, 
              :on => :update
    

    You may also want to add a note on the form, the password fields are only required if you are changing your password or your email address.

    You can check object.new_record? (as Mr Yoshiji mentions) to determine if it’s a new record (no id yet) or an existing record to change your form hints.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let say I have a site which want a OSQA , and a php
I have already a site with a single homepage index.php which accepts 2 parameters
I have Drupal 7 site which is working fine. I added a custom PHP
I have a system for a file hosting site which requires a PHP script
I have built a site using php and want to try keep it one
I have a php-site with a form on which i output preselected values via
I have a rather big php site, which was written for php4 and register_globals
I have a PHP-based site with bookings/appointments stored in a MySQL database. I want
I have a php site, which is basically like a site directory, what I
So, I have at site where I want pages such as; www.example.com/shop/index.php (or any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.