Module: Blogit::PostsHelper
- Defined in:
- app/helpers/blogit/posts_helper.rb
Instance Method Summary (collapse)
-
- (Object) archive_list_for_posts(archive_posts)
Creates a ul tag tree with posts by year and months.
-
- (Object) comments_for_post(post)
Renders the comments for a Post based on the Configuration::include_comments configuration.
-
- (Object) related_posts_for_post(post)
Returns the Posts that share one or more of the same tags for a given post.
-
- (Object) share_bar_for_post(post)
Renders the comments for a JS share bar based on the Configuration::include_share_bar configuration.
Instance Method Details
- (Object) archive_list_for_posts(archive_posts)
Creates a ul tag tree with posts by year and months. Include blogit/archive.js in your js to enabled expand collapse.
43 44 45 |
# File 'app/helpers/blogit/posts_helper.rb', line 43 def archive_list_for_posts(archive_posts) render Blogit::Archive::List.new(archive_posts) end |
- (Object) comments_for_post(post)
Renders the comments for a Blogit::Post based on the Configuration::include_comments configuration
8 9 10 11 12 |
# File 'app/helpers/blogit/posts_helper.rb', line 8 def comments_for_post(post) comment_type = Blogit.configuration.include_comments render(partial: "blogit/comments/#{comment_type}_comments", locals: { post: post, comment: Blogit::Comment.new }) end |
- (Object) related_posts_for_post(post)
Returns the Posts that share one or more of the same tags for a given post
26 27 28 |
# File 'app/helpers/blogit/posts_helper.rb', line 26 def (post) post..active end |
- (Object) share_bar_for_post(post)
Renders the comments for a JS share bar based on the Configuration::include_share_bar configuration
16 17 18 19 |
# File 'app/helpers/blogit/posts_helper.rb', line 16 def (post) return "" unless Blogit.configuration. render(partial: "blogit/posts/share_bar", locals: { post: post}) end |