Forum: Ruby on Rails Storing Search Entries - Use serialize?

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.
8e73782b5a220c5d923a0195667e7406?d=identicon&s=25 Kim (Guest)
on 2007-03-20 22:59
(Received via mailing list)
I have a search box on a web page that I want to store the last 20
search entries and randomly display 5 of those search entries when the
page is loaded - as a way to give users search topic tips. I can not
figure out how to store and then display the search entries.

My idea is to put the search entry in the database by a
remote_function call when the user submits the search. In my view I
will loop through the column and randomly pull 5 search entries to
display. My model will control the number of entries.

How should I store the search entries? I have read about serialize,
but am not understanding how to insert and pull values from. Any ideas
on storing the entries? If serialize is the right way how do I use it?

Thanks in advance, K
This topic is locked and can not be replied to.