# Need advise with search / browsing

**URL:** <https://www.ruby-forum.com/t/need-advise-with-search-browsing/183578>\
**Category:** Rails\
**Created:** [February 16, 2010, 9:31pm UTC](https://www.ruby-forum.com/t/need-advise-with-search-browsing/183578 "2010-02-16T21:31:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomtt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e47c2d/32.png) [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Post date:** [February 16, 2010, 9:31pm UTC](https://www.ruby-forum.com/t/need-advise-with-search-browsing/183578/1 "2010-02-16T21:31:16Z")

</div>

hi,

have a JOB-model, which belongs\_to a variety of other models, eg:  
Industry, Category etc…  
i have:  
######################  
controller:

def browse  
@jobs = Job.all

```
@jobind = JobIndustry.all
@jobcat = JobCategory.all
@joblevelexp = LevelOfExperience.all
@joblevelcareer = LevelOfCareer.all
@jobleveledu = LevelOfEdu.all
@jobyearsexp = YearsOfExperience.all
@joblocation = JobLocation.all

respond_to do |format|
  format.html # index.html.erb
  format.xml { render :xml => @jobs }
end

```

end  
######################  
view:  
literates through all the variables from the controller, and displays  
them each a html-div including a COUNT of the JOBS.

######################  
question:

i want to transform the html-output into a link, so that if i click eg  
onto the INDUSTRY: “Telephone” or whatever, i want the whole result to  
be filtered. not sure how to do that…

an live example is [monster.com](http://monster.com), when u got o browse jobs.

//this is just a learning platform

thx tom

---

<div class="post-metadata">

**Author:** ![tomtt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e47c2d/32.png) [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Post date:** [February 16, 2010, 10:11pm UTC](https://www.ruby-forum.com/t/need-advise-with-search-browsing/183578/2 "2010-02-16T22:11:38Z")

</div>

am i better of with that ?(from the api):

Post.find(:all, :include =\> [:author, :comments], :conditions =\>  
[‘comments.approved = ?’, true])

can i add as many conditions as i want to the individual associations?

thx

---

<div class="post-metadata">

**Author:** ![tomtt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e47c2d/32.png) [@tomtt](https://www.ruby-forum.com/u/tomtt)\
**Post date:** [February 17, 2010, 7:11pm UTC](https://www.ruby-forum.com/t/need-advise-with-search-browsing/183578/3 "2010-02-17T19:11:55Z")

</div>

Check out the searchlogic gem, it will make your life way easier on  
this.

Jarin U.  
Robot Mode LLC
