Storing search value in database


We got a search form (with autocomplete) for airlinetickets. The idea is
that we want to store the search query of all our visitors in our
database. The objective is to add this info to our management info.

Someone ideas?


#37 Simple Search Form - RailsCasts — Simple Search form

#111 Advanced Search Form - RailsCasts — Advanced Search

On Jun 9, 4:30 pm, Remco S. [email protected]

Not sure exactly what the issue is…

Create a model (say, SearchQueries) and whenever anybody hits your
search controller — presumably you only want to capture full queries
and not auto-complete requests – save the query into the database.

If you’re using an autocomplete search which provides links direct to
particular pages, you may also need to capture these - probably by
appending a parameter to the address and making sure that you create
and save a search query when someone hits those pages straight from
the autocomplete list.


On Jun 9, 12:30 pm, Remco S. [email protected]