fixes to limit
This commit is contained in:
@@ -5,7 +5,7 @@ class PostsController < ApplicationController
|
||||
rescue_from PostSets::SearchError, :with => :search_error
|
||||
|
||||
def index
|
||||
@post_set = PostSets::Post.new(tag_query, params[:page])
|
||||
@post_set = PostSets::Post.new(tag_query, params[:page], params[:limit])
|
||||
@posts = @post_set.posts
|
||||
respond_with(@posts) do |format|
|
||||
format.atom
|
||||
|
||||
@@ -105,7 +105,7 @@ class WikiPage < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def post_set
|
||||
@post_set ||= PostSets::WikiPage.new(title)
|
||||
@post_set ||= PostSets::WikiPage.new(title, 1, 4)
|
||||
end
|
||||
|
||||
def presenter
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
module PostSetPresenters
|
||||
class WikiPage < Post
|
||||
def posts
|
||||
Thread.current["records_per_page"] = 4
|
||||
@post_set.posts
|
||||
ensure
|
||||
Thread.current["records_per_page"] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user