Problem updating a database field from my controller
- by ben
I have an update method in my users controller that I call from a HTTPService in Flex 4. The update method is as follows:
def updateName
@user = User.find_by_email(params[:email])
@user.name = params[:nameNew]
render :nothing => true
end
This is console output:
Processing UsersController#updateName
(for 127.0.0.1 at 2010-05-24 14:12:49)
[POST]
Parameters: {"action"="updateName",
"nameNew"="ben",
"controller"="users",
"email"="[email protected]"}
User Load (0.6ms) SELECT * FROM
"users" WHERE ("users"."email" =
'[email protected]') LIMIT 1
Completed in 20ms (View: 1, DB: 1) |
200 OK
[http://localhost/users/updateName]
But when I check my database, the name field is never updated. What am I doing wrong? Thanks for reading.