debshots/app/controllers/packages_controller.rb
2013-08-08 23:14:28 +02:00

26 lines
551 B
Ruby

class PackagesController < ApplicationController
def index
@packages = Package
if params[:search]
@packages = @packages.text_search(params[:search])
end
if params[:with_screenshots]=='yes'
# Limit the packages to those that have approved screenshots.
# Also eager-load the screenshots.
@packages = @packages.includes(:screenshots).where("screenshots.approved"=>true)
end
@packages = @packages.limit(20)
end
def with_screenshots
end
def without_screenshots
end
def moderate
end
end