- @report = @issue.reports.build(report_params)
- @report.user_id = @user.id
- if @issue.save!
- redirect_to root_path, notice: 'Your report has been registered sucessfully.'
- else
- render :new
+
+ if params[:status] && params[:status][0].present?
+ @issues = @issues.where(:status => params[:status][0])
+ end
+
+ if params[:issue_type] && params[:issue_type][0].present?
+ @issues = @issues.where(:reportable_type => params[:issue_type][0])
+ end
+
+ if params[:last_updated_by] && params[:last_updated_by][0].present?
+ last_updated_by = params[:last_updated_by][0].to_s == "nil" ? nil : params[:last_updated_by][0].to_i
+ @issues = @issues.where(:updated_by => last_updated_by)