Displaying 2 results from an estimated 2 matches for "scheduled_courses".
2006 Feb 20
0
No Magic for HABTM forms?
...'t have habtm magic beyond a
certain point.
Here was my solution for others who might have the problem. Also, I
hope someone shows me that there is a simpler way.
The Database Model:
class Registration < ActiveRecord::Base
has_and_belongs_to_many :people
has_and_belongs_to_many :scheduled_courses
end
class ScheduledCourse < ActiveRecord::Base
belongs_to :course
belongs_to :teacher
has_many :course_dates
belongs_to :location
has_and_belongs_to_many :registrations
end
class Person < ActiveRecord::Base
has_and_belongs_to_many :registrations
end
What I needed was to h...
2006 Feb 20
0
How to reference a field of an associated object in a text_field
Hi,
I hope someone can help, I am stumped.
I have a Registration ActiveRecord object. It records registrations
for people for classes.
class Registration
has_and_belongs_to_many :people
has_and_belongs_to_many :scheduled_courses
end
I have a form that allows someone to register. A registration form
will register two people. They fill in their names, addresses, and
the classes they want to register.
I am trying to uniquely identify the first and last names of the two
registrants in my form so that the rails magic wi...