hi all, i have a parent by namr "consultancy" I want to create more than 1 child models for analready existing consultancy which has some extra feilds Plz help me in this regard.
Colin Law
2009-Aug-31 08:56 UTC
Re: creating more than 1 child for an already existing parent
2009/8/31 Kart <akramwasim1234-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > hi all, > > i have a parent by namr "consultancy" > > I want to create more than 1 child models for analready existing > consultancy which has some extra feildsDo you mean that you have Consultancy has_many :children and you now want to change the Child model so that it has extra fields? Colin
Hi Colin, Yes, Consultancy has_many :children but what i want to do is creating many childrens in the same form for an already existing consultancy. plz help me in this regard On Aug 31, 1:56 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2009/8/31 Kart <akramwasim1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > hi all, > > > i have a parent by name "consultancy" > > > I want to create more than 1 child models for analready existing > > consultancy which has some extra feilds > > Do you mean that you have > Consultancy has_many :children > > and you now want to change the Child model so that it has extra fields? > > Colin
Colin Law
2009-Aug-31 09:25 UTC
Re: creating more than 1 child for an already existing parent
2009/8/31 Kart <akramwasim1234-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > Hi Colin, > > Yes, Consultancy has_many :children > > but what i want to do is creating many childrens in the same form for > an already existing consultancy. >You want to look at Nested Forms I think. The rails guide Getting Started (I presume you have worked through the guides?) gives a brief introduction to this and google will provide many links. Colin> plz help me in this regard > > On Aug 31, 1:56 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> 2009/8/31 Kart <akramwasim1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> >> >> >> > hi all, >> >> > i have a parent by name "consultancy" >> >> > I want to create more than 1 child models for analready existing >> > consultancy which has some extra feilds >> >> Do you mean that you have >> Consultancy has_many :children >> >> and you now want to change the Child model so that it has extra fields? >> >> Colin > > >
Abhinav Saxena
2009-Aug-31 09:30 UTC
Re: creating more than 1 child for an already existing parent
You can see Railscasts #73, #74, #75 which deals with the same problem. Also searching on any search engine will also help. -- Thanks, Abhinav http://twitter.com/abhinav On Mon, Aug 31, 2009 at 2:46 PM, Kart <akramwasim1234-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi Colin, > > Yes, Consultancy has_many :children > > but what i want to do is creating many childrens in the same form for > an already existing consultancy. > > plz help me in this regard > > On Aug 31, 1:56 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > 2009/8/31 Kart <akramwasim1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > > > > > hi all, > > > > > i have a parent by name "consultancy" > > > > > I want to create more than 1 child models for analready existing > > > consultancy which has some extra feilds > > > > Do you mean that you have > > Consultancy has_many :children > > > > and you now want to change the Child model so that it has extra fields? > > > > Colin > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
thanks Colin but The children is a single model(single DB table) and what i want to do is create multiple instance of children from a single form with validation for the child fields but the normal new and create method doesn''t provide for creating multiple innstance of a model in single form ,It just provides creating a single instance On Aug 31, 2:25 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2009/8/31 Kart <akramwasim1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > Hi Colin, > > > Yes, Consultancy has_many :children > > > but what i want to do is creating many childrens in the same form for > > an already existing consultancy. > > You want to look at Nested Forms I think. The rails guide Getting > Started (I presume you have worked through the guides?) gives a brief > introduction to this and google will provide many links. > > Colin > > > plz help me in this regard > > > On Aug 31, 1:56 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >> 2009/8/31 Kart <akramwasim1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > >> > hi all, > > >> > i have a parent by name "consultancy" > > >> > I want to create more than 1 child models for analready existing > >> > consultancy which has some extra feilds > > >> Do you mean that you have > >> Consultancy has_many :children > > >> and you now want to change the Child model so that it has extra fields? > > >> Colin
Colin Law
2009-Aug-31 09:54 UTC
Re: creating more than 1 child for an already existing parent
2009/8/31 Kart <akramwasim1234-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > thanks Colin > > but The children is a single model(single DB table) > > and what i want to do is create multiple instance of children from a > single form with validation for the child fieldsThat is what Nested Forms do. See section 9 in the getting started guide. Colin> > but the normal new and create method doesn''t provide for creating > multiple innstance of a model in single form ,It just provides > creating a single instance > > On Aug 31, 2:25 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> 2009/8/31 Kart <akramwasim1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> >> >> >> > Hi Colin, >> >> > Yes, Consultancy has_many :children >> >> > but what i want to do is creating many childrens in the same form for >> > an already existing consultancy. >> >> You want to look at Nested Forms I think. The rails guide Getting >> Started (I presume you have worked through the guides?) gives a brief >> introduction to this and google will provide many links. >> >> Colin >> >> > plz help me in this regard >> >> > On Aug 31, 1:56 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> 2009/8/31 Kart <akramwasim1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> >> >> > hi all, >> >> >> > i have a parent by name "consultancy" >> >> >> > I want to create more than 1 child models for analready existing >> >> > consultancy which has some extra feilds >> >> >> Do you mean that you have >> >> Consultancy has_many :children >> >> >> and you now want to change the Child model so that it has extra fields? >> >> >> Colin > > >
Thanks a lot Colin .......... On Aug 31, 2:54 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2009/8/31 Kart <akramwasim1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > thanks Colin > > > but The children is a single model(single DB table) > > > and what i want to do is create multiple instance of children from a > > single form with validation for the child fields > > That is what Nested Forms do. See section 9 in the getting started guide. > > Colin > > > > > but the normal new and create method doesn''t provide for creating > > multiple innstance of a model in single form ,It just provides > > creating a single instance > > > On Aug 31, 2:25 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >> 2009/8/31 Kart <akramwasim1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > >> > Hi Colin, > > >> > Yes, Consultancy has_many :children > > >> > but what i want to do is creating many childrens in the same form for > >> > an already existing consultancy. > > >> You want to look at Nested Forms I think. The rails guide Getting > >> Started (I presume you have worked through the guides?) gives a brief > >> introduction to this and google will provide many links. > > >> Colin > > >> > plz help me in this regard > > >> > On Aug 31, 1:56 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >> >> 2009/8/31 Kart <akramwasim1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > >> >> > hi all, > > >> >> > i have a parent by name "consultancy" > > >> >> > I want to create more than 1 child models for analready existing > >> >> > consultancy which has some extra feilds > > >> >> Do you mean that you have > >> >> Consultancy has_many :children > > >> >> and you now want to change the Child model so that it has extra fields? > > >> >> Colin
thanks a lot colin On Aug 31, 2:54 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2009/8/31 Kart <akramwasim1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > thanks Colin > > > but The children is a single model(single DB table) > > > and what i want to do is create multiple instance of children from a > > single form with validation for the child fields > > That is what Nested Forms do. See section 9 in the getting started guide. > > Colin > > > > > but the normal new and create method doesn''t provide for creating > > multiple innstance of a model in single form ,It just provides > > creating a single instance > > > On Aug 31, 2:25 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >> 2009/8/31 Kart <akramwasim1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > >> > Hi Colin, > > >> > Yes, Consultancy has_many :children > > >> > but what i want to do is creating many childrens in the same form for > >> > an already existing consultancy. > > >> You want to look at Nested Forms I think. The rails guide Getting > >> Started (I presume you have worked through the guides?) gives a brief > >> introduction to this and google will provide many links. > > >> Colin > > >> > plz help me in this regard > > >> > On Aug 31, 1:56 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >> >> 2009/8/31 Kart <akramwasim1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > >> >> > hi all, > > >> >> > i have a parent by name "consultancy" > > >> >> > I want to create more than 1 child models for analready existing > >> >> > consultancy which has some extra feilds > > >> >> Do you mean that you have > >> >> Consultancy has_many :children > > >> >> and you now want to change the Child model so that it has extra fields? > > >> >> Colin