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 9204159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:38:33+00:00 2026-06-17T23:38:33+00:00

I am working with devise in Rails3. I am facing one problem to update

  • 0

I am working with devise in Rails3. I am facing one problem to update attribute of user. This is current user, and when I am trying to update user, its not updating. when I see in @user.errors, it says that password can’t be blank. I have gone through the devise docs for this and use upate_without_password(params[:user]) but not working for me. Just for to know that I am using Mongodb. I have also gone through the same questions posted in stackoverflow but not working for me. Let me share the code:

in user model:
There is validation of password like this :

validates :password,
    presence: true,
    confirmation: true,
    length: { minimum: 5, maximum: 16 }

in user controller:

protect_from_forgery except: :update
  def update
    @user = User.find(params[:id])

    if @user.update_without_password(params[:user])          
      sign_in(current_user, :bypass=>true)
      respond_to do |format|
        format.json {render :json => current_user.to_json(:only =>  [ :status])}
      end
    else         
      respond_to do |format|
        format.json {render :json => @user.errors.to_json}
      end
    end
  end

This is the parameters I am sending in request

Parameters: {"user"=>{"status"=>"verified", "_id"=>"user1"}, "id"=>"user1"}

I have also tried in Rails console. its showing false when I update_attributes but when I inspect the user object its shows me updated.

1.9.3p286 :008 > user.update_attributes({"status"=>"verified"})
 => false 

Any suggestion what I am missing ?

  • 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-17T23:38:34+00:00Added an answer on June 17, 2026 at 11:38 pm

    Check in your User model whether you have specified this:

    validates :password,:presence=>true
    

    change the above validation to be done only on creating a user like this:

    validates :password,:presence=>true,:on=>:create
    

    This will skip the password validation while updating

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

Sidebar

Related Questions

I'm trying to get Devise working. I'm following this tutorial which tells me to
I'm working with Rails 3.2.2. And I have a devise model called user. In
I use the devise's authenticate_user! method in a controller. This is working fine when
Help, I've broken my Rails3 user model! I first noticed that I could not
I want to update/edit a devise user from my own form in my project,
I'm working on trying to get Devise working in my Rails app. I'm a
I am working on a new app and am trying to customize where Devise
I'm working on integrating my Rails 3.1 app running Devise for user authentication with
Prototype working ternary device Quantum computing with qbits and so on is one thing,
I'm trying to use the Mongoid / Devise Rails 3.1 template ( Mongoid and

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.