With Devise, you don’t have to bcrypt yourself. By default, it handles this and the change password method. You can look at the source here or just look at config/intitalizers/devise.rb in your Rails application.
Also, if you use the #update_with_password method provided by Devise, you can pass the hash to it like this:
{ :current_password => 'pass', :password => 'pass_new', :password_confirmation => 'pass_new' }
Or you can omit :password_confirmation if you do not want the user to provide confirmation.
EDIT: I used the wrong field; it should have been "current_password" instead of "old_password".
Here's the method in source for Devise:
View on GitHub
source share