lib/ecrire/app/helpers/admin/posts_helper.rb in ecrire-0.28.3 vs lib/ecrire/app/helpers/admin/posts_helper.rb in ecrire-0.29.0
- old
+ new
@@ -1,12 +1,16 @@
module Admin
module PostsHelper
def post_tags(post)
- tags = post.tags.map do |tag|
- tag.name.capitalize
+ if post.tags.any?
+ tags = post.tags.map(&:name).join(', ') << '.'
+ else
+ tags = 'No tag yet.'
end
- tags.join(', ')
+
+ tags << ' ' << link_to('Change tags', admin_post_tags_path(post), remote: true)
+ content_tag :div, tags.html_safe, class: %w(tags), as: 'Post.Tags'
end
def edit_content_tag(post)
content_tag :article, id: 'PostBody', postid: @post.id,
class: %w(content),