diff --git a/app/controllers/spectrums_controller.rb b/app/controllers/spectrums_controller.rb index 0be343c4..f3b2c31c 100755 --- a/app/controllers/spectrums_controller.rb +++ b/app/controllers/spectrums_controller.rb @@ -59,12 +59,12 @@ def compare # non REST def search params[:id] = params[:q].to_s if params[:id].nil? - @spectrums = Spectrum.find(:all, :conditions => ['title LIKE ? OR notes LIKE ?',"%"+params[:id]+"%", "%"+params[:id]+"%"],:limit => 100, :order => "id DESC") + @spectrums = Spectrum.where('title LIKE ? OR notes LIKE ?',"%"+params[:id]+"%", "%"+params[:id]+"%").order("id DESC").paginate(:page => params[:page]) @spectrums = @spectrums.paginate :page => params[:page], :per_page => 24 if params[:capture] render :partial => "capture/results", :layout => false else - @sets = SpectraSet.find(:all, :conditions => ['title LIKE ? OR notes LIKE ?',"%"+params[:id]+"%", "%"+params[:id]+"%"],:limit => 100, :order => "id DESC") + @sets = SpectraSet.where('title LIKE ? OR notes LIKE ?',"%"+params[:id]+"%", "%"+params[:id]+"%").order("id DESC").paginate(:page => params[:set_page]) end end diff --git a/app/views/spectrums/search.html.erb b/app/views/spectrums/search.html.erb index cd8f7a4e..3d8564ae 100644 --- a/app/views/spectrums/search.html.erb +++ b/app/views/spectrums/search.html.erb @@ -16,10 +16,12 @@