I have an existing entry in my DB under the “users” table that has a
column name “pic”. I have a file column field when a new user signs up,
and it work great. I am now trying to give existing users the ability to
add or change their “pic”. But, no matter what I do the entry comes up
blank. Here’s what I have so far:
controller:
def settings_save @user = User.find(params[:id]) @user.update_attribute(“pic”, params[:pic])
end
In the log:
Parameters: {“user”=>{“pic_temp”=>"", “pic”=>#<File:/tmp/CGI11901.1>},
“commit”=>“Change”, “action”=>“settings_save”, “id”=>“9”,
“controller”=>“account”}
It seems the variable is not being passed correctly. Any ideas?
Steve, you’re my new hero! That was it. I was calling a param that
didn’t exist. Just in case someone searches for this later you forgot
the last ‘)’ in the code you gave. The final ine is: