impress/app/controllers/items_controller.rb

13 lines
286 B
Ruby
Raw Normal View History

2010-05-15 10:47:46 -07:00
class ItemsController < ApplicationController
def index
if params.has_key?(:q)
@query = params[:q]
begin
2010-05-15 11:14:17 -07:00
@results = Item.search(@query).alphabetize.paginate :page => params[:page]
2010-05-15 10:47:46 -07:00
rescue
2010-05-15 15:26:27 -07:00
flash.now[:alert] = $!.message
2010-05-15 10:47:46 -07:00
end
end
end
end