impress/app/controllers/items_controller.rb

13 lines
282 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
flash[:alert] = $!.message
end
end
end
end