fix post con test
This commit is contained in:
@@ -4,7 +4,7 @@ class PostsController < ApplicationController
|
|||||||
respond_to :html, :xml, :json
|
respond_to :html, :xml, :json
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@post_set = PostSets::Post.new(params)
|
@post_set = PostSets::Post.new(tag_query, params[:page])
|
||||||
@posts = @post_set.posts
|
@posts = @post_set.posts
|
||||||
respond_with(@posts)
|
respond_with(@posts)
|
||||||
end
|
end
|
||||||
@@ -30,9 +30,13 @@ class PostsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
def tag_query
|
||||||
|
params[:tags] || (params[:post] && params[:post][:tags])
|
||||||
|
end
|
||||||
|
|
||||||
def save_recent_tags
|
def save_recent_tags
|
||||||
if params[:tags] || (params[:post] && params[:post][:tags])
|
if tag_query
|
||||||
tags = Tag.scan_tags(params[:tags] || params[:post][:tags])
|
tags = Tag.scan_tags(tag_query)
|
||||||
tags = TagAlias.to_aliased(tags) + Tag.scan_tags(session[:recent_tags])
|
tags = TagAlias.to_aliased(tags) + Tag.scan_tags(session[:recent_tags])
|
||||||
session[:recent_tags] = tags.uniq.slice(0, 40).join(" ")
|
session[:recent_tags] = tags.uniq.slice(0, 40).join(" ")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user