lib/forge/app/controllers/forge/dispatches_controller.rb in forge-cli-0.1.4 vs lib/forge/app/controllers/forge/dispatches_controller.rb in forge-cli-0.1.5
- old
+ new
@@ -4,10 +4,11 @@
def index
respond_to do |format|
format.html { @dispatches = Dispatch.paginate(:per_page => 10, :page => params[:page]) }
format.js {
- @dispatches = Dispatch.where("title LIKE ?", "%#{params[:q]}%")
+ params[:q] ||= ''
+ @dispatches = Dispatch.where("LOWER(subject) LIKE ? OR LOWER(content) LIKE ?", "%#{params[:q].downcase}%", "%#{params[:q].downcase}%")
render :partial => "dispatch", :collection => @dispatches
}
end
end