Sha256: 4d2343375e30b05888f3b7b5447feb87a56d9bce493ab01e177d25dc300ebf30

Contents?: true

Size: 594 Bytes

Versions: 1

Compression:

Stored size: 594 Bytes

Contents

class SearchController < ApplicationController
  
  def results
    if params[:q]
      @search = params[:q]
      @backlogs = Backlog.find(:all, :conditions => ["lower(name) LIKE ?", "%#{@search.downcase}%"])
      @tasks = Task.find(:all, :conditions => ["lower(description) LIKE ? OR lower(notes) LIKE ?", "%#{@search.downcase}%", "%#{@search.downcase}%"])
      @works = Work.find(:all, :conditions => ["lower(description) LIKE ? OR lower(notes) LIKE ?", "%#{@search.downcase}%", "%#{@search.downcase}%"])
    else
      @backlogs = []
      @tasks = []
      @works = []
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
backlog-0.36.2 app/controllers/search_controller.rb