jeudi 11 juin 2015

Issue showing data from related tables in Rails 4

Hi I am fairly new to Rails and I seem to be having a problem. I want to create a relationship between departments and managers. A manager belongs to 1 department but a department can have multiple managers. A manager has an id, a name and a department in the database and the department has id and a name. I want the managers index view to show the departments in a dropdown sorted by name and I want the managers index view to display the departments name that the manager is associated to. Can someone please help as I have tried many things but I cant ge the relationship to work.

Aucun commentaire:

Enregistrer un commentaire