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
|
2010-05-15 17:46:41 -07:00
|
|
|
|
|
|
|
def show
|
|
|
|
@item = Item.find params[:id]
|
|
|
|
end
|
2010-05-15 10:47:46 -07:00
|
|
|
end
|