X-Git-Url: https://irasnyder.com/gitweb/?a=blobdiff_plain;f=app%2Fcontrollers%2Fcustomer_controller.rb;h=1e560c0e67236fa049fe2ea3c328a0631f8096a7;hb=233a6b122bc4aed44a0babee0797d2dba6da5b06;hp=d741644dc603a2d942a461a3d347a33dbf213068;hpb=c9f35305eb2750116e7a073265ea6f1081226895;p=cs356-p2-videostore.git diff --git a/app/controllers/customer_controller.rb b/app/controllers/customer_controller.rb index d741644..1e560c0 100644 --- a/app/controllers/customer_controller.rb +++ b/app/controllers/customer_controller.rb @@ -1,4 +1,8 @@ class CustomerController < ApplicationController + + # Make sure that the user has logged in before they can take any action + before_filter :authorize + def index list render :action => 'list' @@ -55,6 +59,6 @@ class CustomerController < ApplicationController def searchresults query = params[:q] - @customers = Customer.find(:all, :conditions => ["name = ?", query]) + @customers = Customer.find(:all, :conditions => ["name like ?", query[0]+"%"] ) end end