srct / schedules

Browse the GMU course catalog, professors, and build your course schedule
https://schedules.gmu.edu
Apache License 2.0
2 stars 0 forks source link

Resolved issue 29 #32

Closed Nicholas-Thor-Page closed 4 years ago

Nicholas-Thor-Page commented 4 years ago

Resolved #29 by only redirecting to the course page when a course with the specified CRN is found.

When a CRN is entered in the search, search_controller.rb used to ALWAYS send the user to the page for that course. If no course existed with that CRN, it would cause an error, as that page doesn't exist. The new behaviour only redirects to the course page when a course is actually found, otherwise it stays on the query page.

Additionally, the query page did not display a "No Results Found" message when the courses and instructors found were nil values, as it was previously impossible to reach that site with those variables holding nil values. But with the above fix, that is now possible, so now it checks to see if the courses or instructors are empty OR nil, and if they both are, it displays the "No results found" message.