Mike
2006-Nov-24 17:24 UTC
Newby (how to save information of two tables in a single data entry form)
Hello, I''m very new on rails, I discovered it last week so, sorry if my question are stupid, I am wainting for some books on rails, read some documentation but can''t solve this problems. I imported gem for autenticate account (signup, login, logout) but I want to extend it so the user fills some important information that will be stored in other table rather than users, this is the table company, when the user creates their account, a company would be created. So I modify the rhtml of the view, include some fields of the company table, an in the controller user in signup method def signup @user = User.new I inserted this line @company = Company.new also in def create @company = Company.new(params[:firm]) @user = User.new(params[:user]) end The form inserts the data for user, but not for company, any idea how to accomplish this? Thank you --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
KomGBU
2006-Nov-24 17:43 UTC
Re: Newby (how to save information of two tables in a single data entry form)
@company = Company.new(params[:company]) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
KomGBU
2006-Nov-24 17:44 UTC
Re: Newby (how to save information of two tables in a single data entry form)
@company = Company.new(params[:company]) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Mike
2006-Nov-24 18:15 UTC
Re: Newby (how to save information of two tables in a single data entry form)
Sorry, the line is like you mentioned @company = Company.new(params[:company]) and it just insert data in one table Any other 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Phlip
2006-Nov-24 19:18 UTC
Re: Newby (how to save information of two tables in a single data entry form)
Mike wrote:> Sorry, the line is like you mentioned > > @company = Company.new(params[:company]) > > and it just insert data in one tableAnotherTable.create!(params[:another_table]) ? -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---