Module: BlogHelper

Defined in:
app/helpers/blog_helper.rb

Instance Method Summary collapse

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  :span, 'Comments', class: 'disqus-comment-count',
                                        data: { disqus_identifier: post.identifier }
end

#options_for_post_archive_selectObject



7
8
9
10
11
# File 'app/helpers/blog_helper.rb', line 7

def options_for_post_archive_select
  return options_for_select(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_selectObject



3
4
5
# File 'app/helpers/blog_helper.rb', line 3

def 
  return options_from_collection_for_select(SpudPostCategory.ordered, :url_name, :name, params[:category_url_name])
end


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_selectObject



17
18
19
# File 'app/helpers/blog_helper.rb', line 17

def spud_post_archive_select
  return select_tag 'archive_date', options_for_post_archive_select(), prompt: 'All Dates', rel: 'archive', class: 'form-control'
end

#spud_post_category_selectObject



13
14
15
# File 'app/helpers/blog_helper.rb', line 13

def 
  return select_tag('category_url_name', (), prompt: 'All Categories', class: 'form-control')
end