# Storing search results of user in database

**URL:** <https://www.ruby-forum.com/t/storing-search-results-of-user-in-database/138861>\
**Category:** Rails\
**Created:** [May 28, 2008, 1:51pm UTC](https://www.ruby-forum.com/t/storing-search-results-of-user-in-database/138861 "2008-05-28T13:51:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![remco123](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/779978/32.png) [@remco123](https://www.ruby-forum.com/u/remco123)\
**Post date:** [May 28, 2008, 1:51pm UTC](https://www.ruby-forum.com/t/storing-search-results-of-user-in-database/138861/1 "2008-05-28T13:51:45Z")

</div>

Hi,  
I just implemented the advanced search functionality described in

> **[\#111 Advanced Search Form - RailsCasts](http://railscasts.com/episodes/111-advanced-search-form)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

Does someone you have some links where i can find information about  
storing the user’s search results in the database and show them when  
they login.

Grtz…remco

---

<div class="post-metadata">

**Author:** ![remco123](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/779978/32.png) [@remco123](https://www.ruby-forum.com/u/remco123)\
**Post date:** [May 28, 2008, 3:10pm UTC](https://www.ruby-forum.com/t/storing-search-results-of-user-in-database/138861/2 "2008-05-28T15:10:20Z")

</div>

As far as I can tell the idea is not to save the search results, but  
the search parameters.  
In order to bring up the search results when the user logs in again,  
just rerun the search with the stored parameters from the model. Is  
this not sufficient?

On May 28, 7:51 am, Remco Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![remco123](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/779978/32.png) [@remco123](https://www.ruby-forum.com/u/remco123)\
**Post date:** [May 28, 2008, 6:47pm UTC](https://www.ruby-forum.com/t/storing-search-results-of-user-in-database/138861/3 "2008-05-28T18:47:58Z")

</div>

you can save search parameters in database and then reexecute when  
user log back in

---

<div class="post-metadata">

**Author:** ![remco123](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/779978/32.png) [@remco123](https://www.ruby-forum.com/u/remco123)\
**Post date:** [June 2, 2008, 10:18am UTC](https://www.ruby-forum.com/t/storing-search-results-of-user-in-database/138861/4 "2008-06-02T10:18:55Z")

</div>

Harold wrote:

> As far as I can tell the idea is not to save the search results, but  
> the search parameters.  
> In order to bring up the search results when the user logs in again,  
> just rerun the search with the stored parameters from the model. Is  
> this not sufficient?
> 
> On May 28, 7:51ï¿½am, Remco Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

I am a newbie…so if you now some examples/links about “saving  
user-search parameters in database and then reexecute when  
user log back in” it would be a nice start to implement this kind of  
feature in my website…

remco
