app/controllers/courses_controller.rb
# All courses of a specific department, ordered by name
All courses of a specific department, ordered by name
All courses of a specific department ordered by name
def indexByDepartment
		@extra_name = " "+Department.find(params[:dep]).name
		@description = "HYP School's "+Department.find(params[:dep]).name+" department offers these courses, ordered alphabetically:";
		@courses = Course.where("department_id = ?", params[:dep]).order("name").all.group_by{|c| c.name[0]}
		render 'index'
	end
def indexByDepartment @extra_name = " " + Department . find ( params [ :dep ] ) . name @description = "HYP School's " + Department . find ( params [ :dep ] ) . name + " department offers these courses, ordered alphabetically:" ; @courses = Course . where ( "department_id = ?" , params [ :dep ] ) . order ( "name" ) . all . group_by { | c | c . name [ 0 ] } render 'index' end
All courses of a specific department, ordered by name
All courses of a specific department ordered by name