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'
Customer.find(params[:id]).destroy
redirect_to :action => 'list'
end
+
+ def searchbyname
+ render :action => 'searchbyname'
+ end
+
+ def searchresults
+ query = params[:q]
+ @customers = Customer.find(:all, :conditions => ["name like ?", query[0]+"%"] )
+ end
end