Module: Enki::UrlHelper

Included in:
ApplicationController
Defined in:
app/helpers/enki/url_helper.rb

Instance Method Summary collapse

Instance Method Details



17
18
19
20
21
22
23
# File 'app/helpers/enki/url_helper.rb', line 17

def author_link(comment)
  if comment.author_url.blank?
   comment.author
  else
    link_to(comment.author, comment.author_url, :class => 'openid')
  end
end

#post_comments_path(post, comment) ⇒ Object



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

def post_comments_path(post, comment)
  post_path(post) + "/comments"
end

#post_path(post, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'app/helpers/enki/url_helper.rb', line 3

def post_path(post, options = {})
  suffix = options[:anchor] ? "##{options[:anchor]}" : ""
  path = [Enki.config[:engine, :mount_at], post.published_at.strftime("/%Y/%m/%d/") + post.slug + suffix].join
  if options[:only_path] == false
    URI.join(Enki.config[:url], path) 
  else
    path
  end
end