Handle case when category is nil in analyzecontroller

This commit is contained in:
Nelson Jovel 2022-05-30 18:41:56 -07:00
parent 6764024cd2
commit 143e0237e4

View file

@ -1,6 +1,7 @@
class AnalyzeController < SqmApplicationController
def index
@category ||= Category.find_by_category_id(params[:category])
@category ||= Category.first
@categories = Category.all.order(:category_id)
@subcategories = @category.subcategories.order(:subcategory_id)