I am trying to display records that have a specific values in one of the fields.
controller
def mini
@gears = Gear.where("Lab like ?", "%Mini%")
end
The above code displays every record with the value "Mini" in the "Lab" field. I am now trying to make it so it displays records with two different values "Mini" and "Primary". So it would show me all records that have either "Mini" or "Primary" in the lab field.
I tried this
def mini
@gears = Gear.where("Lab like ? AND Lab like ?","%Mini%", "%Primary%)
end
but it did not work. No error is thrown but no records are displayed on my front end webpage. I have also tried different variations but still no luck. Any help on this would be much appreciated.