Module: Blog::PostsHelper

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

Instance Method Summary collapse

Instance Method Details

#date_full(date) ⇒ Object



20
21
22
# File 'app/helpers/blog/posts_helper.rb', line 20

def date_full(date)
  date.strftime('%A %B %d, %Y').gsub(/\s0/, ' ')
end

#post_rss(post) ⇒ Object



11
12
13
14
15
16
17
18
# File 'app/helpers/blog/posts_helper.rb', line 11

def post_rss(post)
  output = []
  post.images.each do |image|
    output << image_tag(image.attachment.url, :alt => image.alt)
  end
  output << post.rendered_body
  output.join("\n").html_safe
end

#post_seo_path(post) ⇒ Object



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

def post_seo_path(post)
  full_post_path(post.year, post.month, post.day, post.to_param)
end

#post_seo_url(post) ⇒ Object



7
8
9
# File 'app/helpers/blog/posts_helper.rb', line 7

def post_seo_url(post)
  full_post_url(post.year, post.month, post.day, post.to_param)
end