найдите ваш объект для обновления в контроллере.
user = User.find_by_id(params[:id])
unless user.blank?
if user.update_attributes(params[:user])
flash[:notice] = "User updated successfully."
redirect_to "somwhere"
else
render :action => 'edit'
end
else
render :action => 'edit'
end
, если вы не хотите обновлять старый пароль, добавьте эти строки перед обновлением, чтобы новый код был:
user = User.find_by_id(params[:id])
unless user.blank?
params[:user].delete(:password) if params[:user][:password].blank?
params[:user].delete(:password_confirmation) if params[:user][:password_confirmation].blank?
if user.update_attributes(params[:user])
flash[:notice] = "User updated successfully."
redirect_to "somwhere"
else
render :action => 'edit'
end
else
render :action => 'edit'
end
напишите что-нибудь подобное в модель user.rb
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :locakable