Re: Re: howto implement a join table

Lorenzo Brito Morales
Tue, 15 Feb 2011 10:59:43 -0000

With you create the structure of rails, the model part, has just that
part done for you,
if you want to find relationchips, just go with models,, lest say
that you have 3 tables, one for workes and another for courses and the
third that has
one worker and one course,in your manageWorkersCourses.html,
you are goint to brings workers and courses like these @workers Worker.all and
@courses =Courses.all
then show it in a combobox,, then in the form pass to the controller
to create a workercourse,
i reccomend you to follow the main tutorial of rails page, its easy,

On Tue, Feb 15, 2011 at 4:50 AM, rogi
<patrik.keller-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
wrote:
>
> On 15 Feb., 11:29, Lorenzo Brito Morales
<lorenzo.br...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> wrote:
>> With Active record , its already link it, i mean, whit @worker.courses
>>  you have a collection of what courses has a worker take it.
>> With scaffold is to set up custom code to controller/view/model .
>
> I dont now about active record! I mean @worker.course doesn''t work
yet
> at my project.
> I just have the two tables and now i try to easily find a way to get
> the html pages, table structures and relations that allow for linking
> the courses to the workers?
> I''m thinking of a manageWorkersCourses.html that let''s me
select a
> worker and then add a course from a dropdown list.
> On the manageWorkersCourses.html page all the courses of the selected
> worker get listed.
>
> BR
> rogi
>
> --
> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.