I have a Collection\_select, with Multiple set to true

```
 #views/courses/new
<%=collection_select(:course, :department_id, Department.all, :id, :name, {},
:multiple =>true,:size => 8,:class=> "text")%>

```

in My Models 

```
#deparment Model
has_many :courses
#Course Model
belongs_to :deparment

```

I want a situation such that if a course has more than one department selected from the Multiple select list, this details is saved in the course Table. My Current Implementation saves just the first selected department for a course, and discards the rest. 
Please how do i achieve this. 

```
def create
@course = Course.new(params[:course] || [])
if @course.save
  redirect_to courses_path, :notice => "Course Created Successfully"
else
  redirect_to new_course_path
  flash[:alert] = "Error Creating Course"
end
end

```

Thank You