projects_controller.rb 507 Bytes
Newer Older
1 2
class Public::ProjectsController < ApplicationController
  skip_before_filter :authenticate_user!,
3 4
                     :reject_blocked, :set_current_user_for_observers,
                     :add_abilities
5 6 7 8

  layout 'public'

  def index
9
    @projects = Project.public_or_internal_only(current_user)
10
    @projects = @projects.search(params[:search]) if params[:search].present?
11
    @projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(20)
12 13
  end
end