0

I have two fields that I am passing into thinking_sphinx, one is a dropdown, the other a free text.

<%= select :search, params[:search], Category.joins(:posts).select('distinct           categories.*').collect {|category| [ category.categoryname,category.categoryname ]}, :include_blank => 'Select a category...' %>

<%= text_field_tag :resume, params[:resume] %>

Its working with just the dropdown, but my syntax seems to be wrong to get the 2nd one to work.

    @posts = Post.search :conditions=>{:search=>params[:search]},{:resume=>params[:resume]}

I'm getting : 3: syntax error, unexpected '\n', expecting tASSOC

Gabe M
  • 515
  • 1
  • 6
  • 18

1 Answers1

1

'conditions' needs to be a hash, you have two hashes. Try this:

@posts = Post.search(:conditions => {:search => params[:search], :resume => params[:resume]})
MrTheWalrus
  • 9,670
  • 2
  • 42
  • 66