working basic state
This commit is contained in:
@@ -16,16 +16,12 @@ class DashboardController < ApplicationController
|
||||
private
|
||||
|
||||
def filter_records
|
||||
records = Joint.all
|
||||
records = records.where(joint: params[:joint]) if params[:joint].present?
|
||||
records
|
||||
if params.include?(:joint)
|
||||
records = Joint.all
|
||||
records = records.where(joint: params[:joint])
|
||||
records
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
|
||||
# old broken: def index
|
||||
# old broken: @joint = Joint.distinct.pluck(:Joint)
|
||||
# old broken:
|
||||
# old broken: @records = Joint.all
|
||||
# old broken:
|
||||
# old broken: @records = @records.where(Joint: params[joint]) if params[:joint].present?
|
||||
# old broken: end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user