help passing an id from a collection_select to my method

Help, I'm trying to pass a course_id from a collection_select and can't figure out how to do it.

If I hard-code my method:

def move_stu   Enrollment.update_all(["course_id = ?", "12" ], :student_id => params [:student_ids])

On Jul 30, 9:54 am, D <> wrote:s:

def move_stu Enrollment.update_all(["course_id = ?", id ], :student_id => params [:student_ids])

## end

but all that passes in is a random 8 digit id from ??? (not the :id from the collection_select)

The id you are using there is the id of the current controller instance. Just as you pick the student_id out of the params hash, the course will be somewhere in params too. If you look in your development.log or play around in the debugger you should be able to figure out where in the params hash it is.