impress/app/controllers/items_controller.rb
2010-05-15 14:14:17 -04:00

12 lines
282 B
Ruby

class ItemsController < ApplicationController
def index
if params.has_key?(:q)
@query = params[:q]
begin
@results = Item.search(@query).alphabetize.paginate :page => params[:page]
rescue
flash[:alert] = $!.message
end
end
end
end