I would like to store the search queries the users enter on my site. I created a model Searches with the corresponding database.
I don’t want the user to know that I am creating an entry based on their search nor do I need to be able to access the searches from the site. I’ll be reading the postgresql database directly every weeks. How can I implement this feature? I tried to do Search.create!(@products) when I am searching, but I get a uninitialized constant PagesController::Search error.
It would be easier to answer the question with more code.
In your search method something like the following should do it and it should be undetectable since it is in the controller: