Module: BlogHelper
- Defined in:
- app/helpers/blog_helper.rb
Instance Method Summary collapse
- #disqus_comment_count_for_post(post) ⇒ Object
- #options_for_post_archive_select ⇒ Object
- #options_for_post_category_select ⇒ Object
- #spud_blog_rss_link ⇒ Object
- #spud_post_archive_select ⇒ Object
- #spud_post_category_select ⇒ Object
Instance Method Details
#disqus_comment_count_for_post(post) ⇒ Object
25 26 27 28 |
# File 'app/helpers/blog_helper.rb', line 25 def disqus_comment_count_for_post(post) return content_tag :span, 'Comments', class: 'disqus-comment-count', data: { disqus_identifier: post.identifier } end |
#options_for_post_archive_select ⇒ Object
7 8 9 10 11 |
# File 'app/helpers/blog_helper.rb', line 7 def return (SpudPost.months_with_public_posts.collect do |d| [d.strftime('%B %Y'), d.strftime('%Y-%b').downcase] end, params[:archive_date]) end |
#options_for_post_category_select ⇒ Object
3 4 5 |
# File 'app/helpers/blog_helper.rb', line 3 def return (SpudPostCategory.ordered, :url_name, :name, params[:category_url_name]) end |
#spud_blog_rss_link ⇒ Object
21 22 23 |
# File 'app/helpers/blog_helper.rb', line 21 def spud_blog_rss_link return tag :link, rel: 'alternate', type: 'application/rss+xml', title: "#{TbCore.site_name} Blog RSS", href: posts_path(format: :rss) end |
#spud_post_archive_select ⇒ Object
17 18 19 |
# File 'app/helpers/blog_helper.rb', line 17 def spud_post_archive_select return select_tag 'archive_date', (), prompt: 'All Dates', rel: 'archive', class: 'form-control' end |
#spud_post_category_select ⇒ Object
13 14 15 |
# File 'app/helpers/blog_helper.rb', line 13 def spud_post_category_select return select_tag('category_url_name', (), prompt: 'All Categories', class: 'form-control') end |