Forum: Ruby on Rails Storing search value in database

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Remco S. (Guest)
on 2009-06-09 15:30

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?

Ram (Guest)
on 2009-06-10 09:13
(Received via mailing list)  --- Simple Search form --- Advanced Search

On Jun 9, 4:30 pm, Remco S. <removed_email_address@domain.invalid>
Matthew MacLeod (Guest)
on 2009-06-10 14:52
(Received via mailing list)
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. <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.