There is the following code:
@owner = Owner.find(params[:id])
if @owner.update(owner_params)
# Some actions
else
render 'edit'
end
'Owner' model has name, email, phone and 2 virtual attributes (for has_secure_password) : password and password_confirmation. I want to update only name, email and phone:
def owner_params
params.require(:owner).permit(:name, :email, :phone)
end
But when I try to update Owner I get a message about blank password, because I use presence validation for password during creating. Please, tell me, is it possible to update only list of sending attributes passing validations other ones? Thanks in advance.
hidden_field? not sure.. - Nithin