views:

30

answers:

0

Hi, I have a rails app which I want to make searchable with tenderlove's texticle. In the console it works fine, but in my app I get an error like this:

/opt/local/lib/ruby/gems/1.8/gems/texticle-1.0.3/lib/texticle.rb:65:in `index'
/Users/vjmayr/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/named_scope.rb:92:in `call'
/Users/vjmayr/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/named_scope.rb:92:in `named_scope'
/Users/vjmayr/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/named_scope.rb:97:in `call'
/Users/vjmayr/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/named_scope.rb:97:in `search'
/Users/vjmayr/softwareclick/app/controllers/categories_controller.rb:12:in `search'

...

def search
          @allproducts = Product.search(params[:search], :conditions => ['category_id in (?)', @category.subtree_ids]) #line 12
        if params[:search]
           @products = Product.search(params[:search], :conditions => ['category_id in (?)', @category.subtree_ids]).paginate :per_page => 30, :page => params[:page] #line 14
         else
           @products = []
         end

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

Can someone point me towards the root of the problem? I am stuck...

Thanks!

Val

P.S. Strange thing about line 12 is, that it shouldn't be used, as I have search in the params .... When I disable it, the error refers to line 14