Hi, I am working on a project that needs a simple search feature but I have hit a roadblock. I need to design a search form that searches a lodging database for certain criteria such as lodge town and lodge amenities but my solution only partially works. My problem is with the Lodge.find method where I keep getting ActiveRecord::StatementInvalid errors. Because I am using a join table for the lodge amenities the find method can't find a has_and_belongs_to_many relationship. I thought active record would be able to handle this relationship for me. Any help would be greatly appreciated. Here is my code:
in lodges_controller: