Employees HABTM projects, projects HABTM employees

The Problem

I am doing a permissions page for a project where I know that I can get all of the employees in the system (@employee.find(:all)) or get all the employees for the selected project.

How can I get a list of all the employees in the system and have a check box that states if they are associated with the current project or not?

A solution

This is just one way of doing this and its very simple once you see it:

Create this and use this methed:

def associated_with_project?(project)
   if self.projects.include? project then
     true
   else
     false
   end
  end