Module: RailsBlogEngine::PostsHelper

Defined in:
app/helpers/rails_blog_engine/posts_helper.rb

Instance Method Summary collapse

Instance Method Details

Link to the comments section of a post.



4
5
6
7
8
9
10
11
# File 'app/helpers/rails_blog_engine/posts_helper.rb', line 4

def link_to_comments_section(post)
  if post.comments.visible.empty?
    link_to("Comment", post_permalink_path(post) + "#comments")
  else
    link_to(pluralize(post.comments.visible.count, 'comment'),
            post_permalink_path(post) + "#comments")
  end
end