El 30/03/11 13:24, simple_n00b escribió:
I would recommend looking at the draft of "rapid rails 3 with hobo"
https://barquin.lighthouseapp.com/projects/63775-rapid-rails-3-with-hobo/tickets/24-beta-1-of-the-book

In this there is an example app created, through a series of
tutorials. in tutorial 8 there is a many to many relationship defined
between "recipes" and "categories" which allows categories to be added
from the form for a recipe. I would suggest trying to duplicate it
with "students" and "courses".

Thanks simple_n00b. In the tutorial you sent the link for had something extra

:dependent => :destroy
and
:accessible => true

So it ends up this way:

hobo new curriculum --setup

hobo generate resource student name:string cedula:integer

hobo generate resource course name:string

hobo generate model student_course

Student has_many :courses, :through =>  :student_courses, :accessible =>  true
Student has_many :student_courses, :dependent =>  :destroy
Course has_many :students, :through =>  :student_courses
Course has_many :student_courses, :dependent =>  :destroy
Student_course belongs_to :student
Student_course belongs_to :course

hobo generate migration

It is working well. Thank you very much. I have a student list with the courses they have taken. This is exactly what I wanted to do.

What I need to do now is make sure the student can reserve a class for the next course he is to take choosing from available course schedules. I will try out some stuff to make this possible.
--
Quiliro Ordóñez
09 821 8696
02 340 1517

--
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to