I am getting username, password and displayname during account signup
and i am putting these values in user table. I have one more table
''userprofile'' which is used for storing firstname, lastname
and other
personal details.
I want to update these personal details and displayname(which is in user
table)from ONE particular page. I can able to update personal details
but not ''displayname''
my controller for updating the form values is given below:
usPrid = params[:userprofile][:id]
dname = params[:displayname]
usPr = Userprofile.find(usPrid)
usPr.update_attributes(params[:userprofile])
userdn = User.find(usPr.user_id)
userdn.displayname = dname
userdn.save
Can you please tell me why that ''displayname'' is not getting
updated?
am i missing some thing? or Is there any restrictions in updating user
account table?
Thanks in advance.
Regards
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
i believe its because your not associating a userdn object to your form for params[:displayname]? have you print out params[:displayname]? do this logger.debug "display name" + params[:displayname] Ruby Quest wrote:> I am getting username, password and displayname during account signup > and i am putting these values in user table. I have one more table > ''userprofile'' which is used for storing firstname, lastname and other > personal details. > > I want to update these personal details and displayname(which is in user > table)from ONE particular page. I can able to update personal details > but not ''displayname'' > > my controller for updating the form values is given below: > > usPrid = params[:userprofile][:id] > dname = params[:displayname] > usPr = Userprofile.find(usPrid) > usPr.update_attributes(params[:userprofile]) > userdn = User.find(usPr.user_id) > userdn.displayname = dname > userdn.save > > > Can you please tell me why that ''displayname'' is not getting updated? > am i missing some thing? or Is there any restrictions in updating user > account table? > > > > Thanks in advance. > > Regards-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Koloa,
Thanks for your reply.
I have associated my userdn object with displayname. See my 2nd line
and 6th line of the controller code.
--------------------------------------------
dname = params[:displayname]
userdn.displayname = dname
-------------------------------------------
development.log file also shows the correct value before assigning and
after assigning new value. So there is no issues up to 6th line in my
controller. but this userdn.save is not working....
Regards
Rubyquest
koloa wrote:>
> i believe its because your not associating a userdn object to your form
> for
>
> params[:displayname]?
>
> have you print out params[:displayname]?
>
> do this
>
> logger.debug "display name" + params[:displayname]
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
oh, i had an issue like this before when i was associating a model that has_one picture. i had to do a myModel.build_mypituretable(params[:uploadfield]) so maybe you may have to do something similiar? Ruby Quest wrote:> Hi Koloa, > > Thanks for your reply. > > I have associated my userdn object with displayname. See my 2nd line > and 6th line of the controller code. > -------------------------------------------- > dname = params[:displayname] > userdn.displayname = dname > ------------------------------------------- > > development.log file also shows the correct value before assigning and > after assigning new value. So there is no issues up to 6th line in my > controller. but this userdn.save is not working.... > > > Regards > Rubyquest > > > > > koloa wrote: >> >> i believe its because your not associating a userdn object to your form >> for >> >> params[:displayname]? >> >> have you print out params[:displayname]? >> >> do this >> >> logger.debug "display name" + params[:displayname]-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---