def ads
@ads = @search.result.recent.completed.paginate(page: params[:page], per_page: 10).limit(10)
end
def events
@events = @search.result.recent.completed.paginate(page: params[:page], per_page: 10).limit(10)
end
def pets
@pets = @search.result.recent.completed.paginate(page: params[:page], per_page: 10).limit(10)
end
def companies
@companies = @search.result.recent.completed.paginate(page: params[:page], per_page: 10).limit(10)
end
如何将此代码重构到某个范围