Find right @repositories in repositories#index

This commit is contained in:
George Vinogradov 2011-11-01 20:27:34 +04:00
parent b9c4ab3170
commit b835c7ad3c
1 changed files with 5 additions and 1 deletions

View File

@ -7,7 +7,11 @@ class RepositoriesController < ApplicationController
before_filter :check_global_access, :only => [:index, :new, :create] before_filter :check_global_access, :only => [:index, :new, :create]
def index def index
@repositories = Repository.paginate(:page => params[:repository_page]) if params[:platform_id]
@repositories = Platform.find(params[:platform_id]).repositories.paginate(:page => params[:repository_page])
else
@repositories = Repository.paginate(:page => params[:repository_page])
end
end end
def show def show