Tag posts from the admin area
This commit is contained in:
@@ -11,7 +11,13 @@ module Admin
|
||||
attrs_to_replace = {}
|
||||
attrs_to_replace[:content] = markdown.call(content: params[:body]) if params[:body]
|
||||
|
||||
tags = params[:tags].split(",").map(&:strip)
|
||||
|
||||
post_repo.update(params[:id], attrs_to_replace)
|
||||
if tags && !tags.empty?
|
||||
post_repo.remove_tags(post_id: params[:id])
|
||||
post_repo.tag_post(post_id: params[:id], tags: tags)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user