T
tom
Hi
Could somebody explain to me why the following doesn't work:
@user = User.findfirst)
@user.attributes[:email] = params[:user][:email] # this does nothing!!
@user.save
but the following DOES work...
@user = User.findfirst)
@user.email = params[:user][:email] # this works like it should?!
@user.save
I only realized this when the @user.update_attributes(params[:user])
didn't seem to do anything. I was under the impression that the two
snippets above did the same thing?
Does anybody else have this problem with @user.update_attributes??
Thanks in advance
Tom Medhurst
Could somebody explain to me why the following doesn't work:
@user = User.findfirst)
@user.attributes[:email] = params[:user][:email] # this does nothing!!
@user.save
but the following DOES work...
@user = User.findfirst)
@user.email = params[:user][:email] # this works like it should?!
@user.save
I only realized this when the @user.update_attributes(params[:user])
didn't seem to do anything. I was under the impression that the two
snippets above did the same thing?
Does anybody else have this problem with @user.update_attributes??
Thanks in advance
Tom Medhurst