blackangel6291-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Oct-15 20:13 UTC
Updating Account Information Trouble
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"=>"blackangel6291-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"},
"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/
update_admin_account_options/16]
I checked the @params with the debug, everything looks ok. Any idea?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
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 :)) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---