# Updating Account Information Trouble

**URL:** <https://www.ruby-forum.com/t/updating-account-information-trouble/117313>\
**Category:** Rails\
**Created:** [October 15, 2007, 10:14pm UTC](https://www.ruby-forum.com/t/updating-account-information-trouble/117313 "2007-10-15T22:14:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 15, 2007, 10:14pm UTC](https://www.ruby-forum.com/t/updating-account-information-trouble/117313/1 "2007-10-15T22:14:03Z")

</div>

Synopsis : The basic ideea is this, user logs into his account,  
acceses a link and wants to edit his info, let’s say first name,  
email, last name. The user session is stored obviously in a session.  
Problem is, I cannot update the information. Here’s the code:

def update\_admin\_account\_options  
@admin = Admin.find(params[:id])  
if request.post?  
if @admin.update\_attributes(params[:admin])  
flash[:notice] = ‘Account information was successfully  
updated.’  
redirect\_to :action =\> ‘edit\_account\_options’, :id =\> @admin  
else  
flash[:notice] = “Account information cannot be updated!”  
render :action =\> ‘edit\_account\_options’  
end  
end  
end

and the development.log

Processing AdminController#update\_admin\_account\_options (for 127.0.0.1  
at 2007-10-15 23:04:42) [POST]  
Session ID: fa51971fbde3e17078b4185894263ad0  
Parameters: {“commit”=\>“Update”, “admin”=\>{“firstname”=\>“test”,  
“lastname”=\>“Angel”, “email”=\>“removed\_email\_address@domain.invalid”},  
“action”=\>“update\_admin\_account\_options”, “id”=\>“16”,  
“controller”=\>“admin”}  
[4;35;1mAdmin Columns (0.000000) [0m [0mSHOW FIELDS FROM  
admins [0m  
[4;36;1mAdmin Load (0.016000) [0m [0;1mSELECT \* FROM admins  
WHERE (admins.`id` = 16) [0m  
[4;35;1mSQL (0.000000) [0m [0mBEGIN [0m  
[4;36;1mAdmin Load (0.000000) [0m [0;1mSELECT \* FROM admins  
WHERE (admins.username = ‘admin’ AND admins.id \<\> 16) LIMIT 1 [0m  
[4;35;1mSQL (0.000000) [0m [0mCOMMIT [0m  
Rendering layoutfalseactionedit\_account\_options within layouts/admin  
Rendering admin/edit\_account\_options  
Completed in 0.29700 (3 reqs/sec) | Rendering: 0.03100 (10%) | DB:  
0.01600 (5%) | 200 OK [[http://127.0.0.1/admin/](http://127.0.0.1/admin/)  
update\_admin\_account\_options/16]

I checked the @params with the debug, everything looks ok. Any idea?

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [October 15, 2007, 10:29pm UTC](https://www.ruby-forum.com/t/updating-account-information-trouble/117313/2 "2007-10-15T22:29:16Z")

</div>

I was wondering, in the model I have several presence verifyers that do  
not  
get updated, could it be that the model checks all the fields and I  
update  
only a few … well, thats the problem, solved it :))
