Use the following format when searching a table for a certain record 
"TableNameCapital.find_by_id(x)"
where x is your id 

so this one would be 
@y = Lecturer.find_by_id(params[:id])