This commit is contained in:
Nicolas VARROT 2015-12-07 21:27:06 +01:00
parent d422a7843f
commit 8e710a7b50

View File

@ -19,7 +19,7 @@ class Public::NeedsController < ApplicationController
@needs = @needs.search(params[:q]) @needs = @needs.search(params[:q])
end end
if(params[:c] != '') if(params[:c] and params[:c] != '')
@category = NeedCategory.find(params[:c]) @category = NeedCategory.find(params[:c])
ids = @category.child_ids ids = @category.child_ids
@needs = @needs.where(category_id: ids) @needs = @needs.where(category_id: ids)