related tags: eliminate recent_tags cookie (#3955).

This commit is contained in:
evazion
2018-10-12 21:18:15 -05:00
parent ae52b487e8
commit d536f75505
4 changed files with 12 additions and 21 deletions

View File

@@ -46,7 +46,6 @@ class PostsController < ApplicationController
@post = Post.find(params[:id])
@post.update(post_params) if @post.visible?
save_recent_tags
respond_with_post_after_update(@post)
end
@@ -96,15 +95,6 @@ private
params[:tags] || (params[:post] && params[:post][:tags])
end
def save_recent_tags
if @post
tags = Tag.scan_tags(@post.tag_string)
tags = (TagAlias.to_aliased(tags) + Tag.scan_tags(cookies[:recent_tags])).uniq.slice(0, 30)
cookies[:recent_tags] = tags.join(" ")
cookies[:recent_tags_with_categories] = Tag.categories_for(tags).to_a.flatten.join(" ")
end
end
def respond_with_post_after_update(post)
respond_with(post) do |format|
format.html do