Re: [Rails] model association

2015-03-04 Thread Vineeth B S
I would say, Colin has given a sound advise. Do take a look at Activerecord Associations and other railsguides pages. They are really great! Vineeth On Tue, Mar 3, 2015 at 2:57 AM, Colin Law wrote: > On 2 March 2015 at 17:24, Palmo > wrot

RE: [Rails] model association

2015-03-03 Thread Julio Papel
Hi Sandro, should it be “has_many :players” instead? If it is many I believe the convention is plural? Then it should work! I believe! Cheers, Julio From: rubyonrails-talk@googlegroups.com [mailto:rubyonrails-talk@googlegroups.com] On Behalf Of Palmo Sent: Monday, March 2, 2015 6:24 PM

Re: [Rails] model association

2015-03-02 Thread Colin Law
On 2 March 2015 at 17:24, Palmo wrote: > Hi, > I've generated 2 models (Player and Trainer) with the "generate scaffold" > command with the following tables: > Player > name:string > last_name:string > trainer:string > team:string > > Trainer > name:string > last_name:string > phone_number:string

Re: [Rails] model association question

2011-09-13 Thread Jesse
On 9/13/11 5:17 PM, Randy Regnier wrote: On 09/13/2011 03:34 PM, Jesse wrote: On 9/13/11 1:22 PM, Randy Regnier wrote: I have a question about how best to model a pair of properties/attributes in Rails3. The generic "models" are: class Foo < ActiveRecord::Base end class Bar < ActiveRecord::Ba

Re: [Rails] model association question

2011-09-13 Thread Randy Regnier
On 09/13/2011 04:21 PM, Colin Law wrote: On 13 September 2011 22:17, Randy Regnier wrote: On 09/13/2011 03:34 PM, Jesse wrote: On 9/13/11 1:22 PM, Randy Regnier wrote: I have a question about how best to model a pair of properties/attributes in Rails3. The generic "models" are: class Foo<

Re: [Rails] model association question

2011-09-13 Thread Colin Law
On 13 September 2011 22:17, Randy Regnier wrote: > On 09/13/2011 03:34 PM, Jesse wrote: >> >> On 9/13/11 1:22 PM, Randy Regnier wrote: >>> >>> I have a question about how best to model a pair of properties/attributes >>> in Rails3. The generic "models" are: >>> >>> class Foo < ActiveRecord::Base >

Re: [Rails] model association question

2011-09-13 Thread Randy Regnier
On 09/13/2011 03:34 PM, Jesse wrote: On 9/13/11 1:22 PM, Randy Regnier wrote: I have a question about how best to model a pair of properties/attributes in Rails3. The generic "models" are: class Foo < ActiveRecord::Base end class Bar < ActiveRecord::Base end I want Foo to have two association

Re: [Rails] model association question

2011-09-13 Thread Jesse
On 9/13/11 1:22 PM, Randy Regnier wrote: I have a question about how best to model a pair of properties/attributes in Rails3. The generic "models" are: class Foo < ActiveRecord::Base end class Bar < ActiveRecord::Base end I want Foo to have two associations with Bar, along the lines of 'has_o