From 28a997c2cd58505f11dc81fa46fe5cb43dbac588 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 26 Apr 2011 20:14:59 -0700 Subject: [PATCH] Fix pagination on tags, specs are red, need to take all helpers out of applicationController --- app/helpers/application_helper.rb | 8 ++++++-- app/helpers/aspects_helper.rb | 3 --- app/helpers/tags_helper.rb | 9 --------- 3 files changed, 6 insertions(+), 14 deletions(-) delete mode 100644 app/helpers/tags_helper.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 600022c09..f3c65d9a4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -5,8 +5,12 @@ module ApplicationHelper @@youtube_title_cache = Hash.new("no-title") - def next_page - params[:page] ? (params[:page].to_i + 1) : 2 + def next_page_path + if @controller.instance_of?(TagsController) + tag_path(@tag, :max_time => @posts.last.send(session[:sort_order].to_sym).to_i) + else + aspects_path(:max_time => @posts.last.send(session[:sort_order].to_sym).to_i, :a_ids => params[:a_ids]) + end end def timeago(time, options = {}) options[:class] ||= "timeago" diff --git a/app/helpers/aspects_helper.rb b/app/helpers/aspects_helper.rb index c495464f3..bcab3a14d 100644 --- a/app/helpers/aspects_helper.rb +++ b/app/helpers/aspects_helper.rb @@ -3,9 +3,6 @@ # the COPYRIGHT file. module AspectsHelper - def next_page_path - aspects_path(:max_time => @posts.last.send(session[:sort_order].to_sym).to_i, :a_ids => params[:a_ids]) - end def link_for_aspect(aspect, opts={}) opts[:params] ||= {} params ||= {} diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb deleted file mode 100644 index 5e205fc55..000000000 --- a/app/helpers/tags_helper.rb +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -module TagsHelper - def next_page_path - tag_path(@tag, :max_time => @posts.last.send(session[:sort_order].to_sym).to_i) - end -end