Module: BlogBasic::BlogPostsHelper

Defined in:
app/helpers/blog_basic/blog_posts_helper.rb

Instance Method Summary collapse

Instance Method Details



12
13
14
15
16
17
# File 'app/helpers/blog_basic/blog_posts_helper.rb', line 12

def carnonical_link(post)
  prefix=""
  url_parts = blog_post_path.split("/") # FIXME: pretty solution is welcome
  url_parts.each { |part| prefix = prefix + part + "/" unless part == url_parts.last }
  "<link rel=\"canonical\" href=\"".html_safe + prefix + post.id.to_s + "\" />".html_safe
end

#display_name(name, site) ⇒ Object



4
5
6
7
8
9
10
# File 'app/helpers/blog_basic/blog_posts_helper.rb', line 4

def display_name(name, site)
  if !site.blank?
    return link_to(name, site, :rel => 'nofollow')
  else
    return name
  end
end