Files
joanna-website/app/controllers/joints_controller.rb

15 lines
455 B
Ruby

class JointsController < ApplicationController
def index
# Grab values:
@available_categories = JointsDashboard.distinct.pluck(:Joint)
# Start with base query:
@records = JointsDashboard.all
# Filter data based on dropdown selection params
@records = @records.where(Joint: params[:joint]) if params[:joint].present?
#@records = @records.where(Joint == params[:joint]) if params[:joint].present?
puts @records
end
end