Commit 89cdfb63 authored by Zach Perkins's avatar Zach Perkins
Browse files

Integrate course_listing with the new file setup

parent 82096fc8
......@@ -7,16 +7,9 @@ class CourseListingController < ApplicationController
param :subject, String, desc: 'Course subject, e.g. "CS" or "ACCT"'
param :number, Integer, desc: 'Course number, e.g. "112"'
def index
db_params = {}
# Grab all of the params we pass to the query from the GET arguments
params.each do |name, value|
db_params[name.to_sym] = value if Course.column_names.include? name
end
# Make a separate list so that we can include sections
@courses = []
Course.where(db_params).all.each do |course_obj|
Course.fetch(params).all.each do |course_obj|
course = course_obj.attributes.dup
course[:sections] = course_obj.course_sections
@courses.push(course)
......
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
// Place all the styles related to the CourseListing controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment