I would say, Colin has given a sound advise. Do take a look at Activerecord
Associations http://guides.rubyonrails.org/association_basics.html and
other railsguides pages. They are really great!
Vineeth
On Tue, Mar 3, 2015 at 2:57 AM, Colin Law clan...@gmail.com wrote:
On 2 March 2015 at
PM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] model association
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
On 2 March 2015 at 17:24, Palmo sandro.palmi...@sportsenzafrontiere.it 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
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
team:string
I've set the association in the Player model
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_one' for each association, where I can work
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_one'
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 associations
On 13 September 2011 22:17, Randy Regnier rbregn...@gmail.com 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
On 09/13/2011 04:21 PM, Colin Law wrote:
On 13 September 2011 22:17, Randy Regnierrbregn...@gmail.com 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
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::Base
It seems like there may be a rails method for the following situation:
model User
has_many :appointments
model Appointment
has_one :instruction
belongs_to :user
model Instruction
belongs_to :appointment
I would like to do User.Appointments.Instruction and return an array
with instruction
11 matches
Mail list logo