Fix LIKE clauses in searches to match anywhere in the field
[cs356-p2-videostore.git] / app / controllers / coitem_controller.rb
index ef8ea7c..152f40b 100644 (file)
@@ -47,6 +47,12 @@ class CoitemController < ApplicationController
     render :action => 'overdue'
   end
 
+  def filterbycustomerid
+    query = params[:id]
+    @coitem_pages, @coitems = paginate :coitems, :per_page => 20, :conditions => ["customer_id = ?", query]
+    render :action => 'list'
+  end
+
   def return
     if request.post?
       rentable_id = params[:rentable_id]