# Storing Search Entries - Use serialize?

**URL:** <https://www.ruby-forum.com/t/storing-search-entries-use-serialize/89510>\
**Category:** Rails\
**Created:** [March 20, 2007, 10:59pm UTC](https://www.ruby-forum.com/t/storing-search-entries-use-serialize/89510 "2007-03-20T22:59:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@kim](https://www.ruby-forum.com/u/kim)\
**Post date:** [March 20, 2007, 10:59pm UTC](https://www.ruby-forum.com/t/storing-search-entries-use-serialize/89510/1 "2007-03-20T22:59:07Z")

</div>

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
