I have a form: <% form_tag :action => ''create'' do %> <%= hidden_field_tag ''plan'', params[:plan] %> <fieldset> <% fields_for :account do |f| %> <%= f.text_field :name %> <%= f.text_field :domain %>.<%= AppConfig[''base_domain''] %> <% end %> </fieldset> <fieldset> <% fields_for :user do |f| %> <%= f.text_field :login %><br/> <%= f.text_field :eservice %> PPL Eservice Login (If Known)<br/><%= f.text_field :first_name %><br/> <%= f.text_field :last_name %><br/> <%= f.text_field :email %><br/> <%= f.text_field :contact_number %><br/> <label for="user_password">Password</label> <%= f.password_field :password %><br/> <label for="user_password_confirmation">Password Confirmation</ label> <%= f.password_field :password_confirmation %> <% end %> </fieldset> I would like to only have the second part of the form and have the fields first_name last_name update the account table name and have login update the account table domain. Do you know how to do this? Thank you, Sean McGilvray -- 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 -~----------~----~----~----~------~----~------~--~---
Julian Leviston
2009-Jan-29 19:48 UTC
Re: Newbie Help Please! Update 2 Tables with one form
Your question doesn''t make enough sense. What are the exact models or table names that you want to update? Sent from my iPhone On 30/01/2009, at 4:01 AM, Sean Mcgilvray <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > wrote:> > I have a form: > > <% form_tag :action => ''create'' do %> > <%= hidden_field_tag ''plan'', params[:plan] %> > > <fieldset> > <% fields_for :account do |f| %> > > <%= f.text_field :name %> > > <%= f.text_field :domain %>.<%= AppConfig[''base_domain''] %> > <% end %> > </fieldset> > > > <fieldset> > <% fields_for :user do |f| %> > <%= f.text_field :login %><br/> > <%= f.text_field :eservice %> PPL Eservice Login (If Known)<br/ >> > <%= f.text_field :first_name %><br/> > <%= f.text_field :last_name %><br/> > <%= f.text_field :email %><br/> > <%= f.text_field :contact_number %><br/> > <label for="user_password">Password</label> > <%= f.password_field :password %><br/> > <label for="user_password_confirmation">Password Confirmation</ > label> > <%= f.password_field :password_confirmation %> > <% end %> > </fieldset> > > I would like to only have the second part of the form and have the > fields first_name last_name update the account table name and have > login update the account table domain. Do you know how to do this? > > Thank you, > > Sean McGilvray > -- > 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 -~----------~----~----~----~------~----~------~--~---
Sean Mcgilvray
2009-Jan-29 20:11 UTC
Re: Newbie Help Please! Update 2 Tables with one form
Julian Leviston wrote:> Your question doesn''t make enough sense. What are the exact models or > table names that you want to update? > > Sent from my iPhone > > On 30/01/2009, at 4:01 AM, Sean Mcgilvray > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.orgMy tables are: 1. Users Field 1: login Field 2: eservice Field 3: first_name Field 4: last_name Field 5: email Field 6: contact_number Field 7: password Field 8: Password Confirmation 2. Account Field 1: name Field 2: domain.<%= AppConfig[''base_domain''] %> I want to only have the user part of the form filled out. When submitted have it update the users table and the account table. It should take the first_name + last_name fields from users and save them into the account table in the name field. Then I want it to take the users login and save it to the account table domain field. I am trying to not the user put the same information in twice for registration. Thank you, Sean McGilvray -- 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 -~----------~----~----~----~------~----~------~--~---
Julian Leviston
2009-Jan-29 20:21 UTC
Re: Newbie Help Please! Update 2 Tables with one form
That makes more sense. It''s much better when people take time to form their questions. I have one question tho - how will you link the user to their account? Anyway, in the destination action of The form - its target - you need to specify two "new" methods rather than just one. Let me know if you need more explanation Sent from my iPhone On 30/01/2009, at 7:11 AM, Sean Mcgilvray <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > wrote:> > Julian Leviston wrote: >> Your question doesn''t make enough sense. What are the exact models or >> table names that you want to update? >> >> Sent from my iPhone >> >> On 30/01/2009, at 4:01 AM, Sean Mcgilvray >> <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > > My tables are: > 1. Users > Field 1: login > Field 2: eservice > Field 3: first_name > Field 4: last_name > Field 5: email > Field 6: contact_number > Field 7: password > Field 8: Password Confirmation > > 2. Account > Field 1: name > Field 2: domain.<%= AppConfig[''base_domain''] %> > > I want to only have the user part of the form filled out. When > submitted have it update the users table and the account table. It > should take the first_name + last_name fields from users and save them > into the account table in the name field. Then I want it to take the > users login and save it to the account table domain field. I am > trying > to not the user put the same information in twice for registration. > > Thank you, > > Sean McGilvray > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Sean McGilvray
2009-Jan-29 20:46 UTC
Re: Newbie Help Please! Update 2 Tables with one form
Thank you for your reply and I will need some more explanation. They are linked through user_id. Thank you, Sean McGilvray & Sarena Byers Director Identity Theft Specialist Pre-Paid Legal Service''s, Inc. NYSE:PPD Phone: 760-486-1019 smcgilvray-C6gt8ZI8z3bIY2DP0bkpxA@public.gmane.org http://www.transferhome.net On Thu, Jan 29, 2009 at 12:21 PM, Julian Leviston <julian-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org>wrote:> > That makes more sense. It''s much better when people take time to form > their questions. > > I have one question tho - how will you link the user to their account? > > Anyway, in the destination action of > The form - its target - you need to specify two "new" methods rather > than just one. Let me know if you need more explanation > > Sent from my iPhone > > On 30/01/2009, at 7:11 AM, Sean Mcgilvray < > rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > > wrote: > > > > > Julian Leviston wrote: > >> Your question doesn''t make enough sense. What are the exact models or > >> table names that you want to update? > >> > >> Sent from my iPhone > >> > >> On 30/01/2009, at 4:01 AM, Sean Mcgilvray > >> <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > > > > My tables are: > > 1. Users > > Field 1: login > > Field 2: eservice > > Field 3: first_name > > Field 4: last_name > > Field 5: email > > Field 6: contact_number > > Field 7: password > > Field 8: Password Confirmation > > > > 2. Account > > Field 1: name > > Field 2: domain.<%= AppConfig[''base_domain''] %> > > > > I want to only have the user part of the form filled out. When > > submitted have it update the users table and the account table. It > > should take the first_name + last_name fields from users and save them > > into the account table in the name field. Then I want it to take the > > users login and save it to the account table domain field. I am > > trying > > to not the user put the same information in twice for registration. > > > > Thank you, > > > > Sean McGilvray > > > > -- > > 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 -~----------~----~----~----~------~----~------~--~---