# Searchlogic

**URL:** <https://www.ruby-forum.com/t/searchlogic/188712>\
**Category:** Rails\
**Created:** [May 17, 2010, 1:07am UTC](https://www.ruby-forum.com/t/searchlogic/188712 "2010-05-17T01:07:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidz101](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Post date:** [May 17, 2010, 1:07am UTC](https://www.ruby-forum.com/t/searchlogic/188712/1 "2010-05-17T01:07:53Z")

</div>

Hey

The guys at the searchlogic google groups seem to be asleep -.-

They didnt’ grant me permission to post yet.

But anyways, right now, I followed the searchlogic tutorial found here  
-[http://www.binarylogic.com/2008/09/07/tutorial-pagination-ordering-](http://www.binarylogic.com/2008/09/07/tutorial-pagination-ordering-)  
and-searching-with-searchlogic/

however, in that tutorial, the results of the find displays all my  
items, before i even search for anything with searchlogic.

I want it so that only after a search is made, will i then want the  
results to get listed. Right now its listing all the results, even  
though I didn’t search

(I know that’s whats supposed to happen, but I want to hide the find  
results until i search)

does anyone know how? Thanks

---

<div class="post-metadata">

**Author:** ![davidz101](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Post date:** [May 17, 2010, 1:37am UTC](https://www.ruby-forum.com/t/searchlogic/188712/2 "2010-05-17T01:37:12Z")

</div>

On Sun, May 16, 2010 at 4:06 PM, David Z.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> however, in that tutorial, the results of the find displays all my

Where’s the exact code?

-Conrad

---

<div class="post-metadata">

**Author:** ![davidz101](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Post date:** [May 17, 2010, 9:21pm UTC](https://www.ruby-forum.com/t/searchlogic/188712/3 "2010-05-17T21:21:47Z")

</div>

David Z. wrote:

> > I want it so that only after a search is made, will i then want the  
> > results to get listed. Right now its listing all the results, even  
> > though I didn’t search
> 
> > (I know that’s whats supposed to happen, but I want to hide the find  
> > results until i search)
> 
> > does anyone know how? Thanks

Conrad wrote:

> Where’s the exact code?

here- this is the view

\<% if @users\_count \> 0 %\>  
\<%= @users\_count %\> users found

```
<table border="1" cellpadding="5">
    <tr>
        <th><%= order_by_link :id %></th>
        <th><%= order_by_link :user_group => :name %></th>
        <th><%= order_by_link :first_name %></th>
        <th><%= order_by_link :last_name %></th>
        <th><%= order_by_link [:email, :first_name] %></th>
    </tr>
    <% @users.each do |user| %>
        <tr>
            <td><%= user.id %></td>
            <td><%= user.user_group ? user.user_group.name : "-"

```

%\>

\<%= user.first\_name %\>  
\<%= user.last\_name %\>  
\<%= user.email %\>  
  
\<% end %\>  

So how do I make it so that the do loop that flips through users don’t  
get displayed until I search something?

---

<div class="post-metadata">

**Author:** ![davidz101](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@davidz101](https://www.ruby-forum.com/u/davidz101)\
**Post date:** [May 19, 2010, 2:25am UTC](https://www.ruby-forum.com/t/searchlogic/188712/4 "2010-05-19T02:25:16Z")

</div>

On May 17, 3:20 pm, David Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > items, before i even search for anything with searchlogic.  
> > > Conrad wrote:
> 
> ```
> <th><%= order_by_link :user_group => :name %></th>
> <td><%= user.last_name %></td>
> <td><%= user.email %></td>
> </tr>
> <% end %>
> </table>
> 
> ```
> 
> So how do I make it so that the do loop that flips through users don’t  
> get displayed until I search something?

No one knows?
