app/controllers/courses_controller.rb
# Main course index, with all courses ordered by name
Main course index, with all courses ordered by name
Main course index with all courses ordered by name
def index
		@extra_name = ""
		@description = "HYP School offers a huge variety of courses to prepare the students in all possible subjects.<br><br>Our curriculum offers the following courses, ordered alphabetically:";
		@courses = Course.order("name").all.group_by{|c| c.name[0]}
	end
def index @extra_name = "" @description = "HYP School offers a huge variety of courses to prepare the students in all possible subjects.<br><br>Our curriculum offers the following courses, ordered alphabetically:" ; @courses = Course . order ( "name" ) . all . group_by { | c | c . name [ 0 ] } end
Main course index, with all courses ordered by name
Main course index with all courses ordered by name