Permalink
Browse files

Fix links to relative paths instead of absolute paths.

This unbreaks the view on a local test system and supports HTTPS more
properly.
  • Loading branch information...
1 parent 9043a05 commit 3bff4ad8d34cf67c2bfbdfd4369d8667608fb0c0 @Flameeyes committed Feb 17, 2013
Showing with 5 additions and 5 deletions.
  1. +3 −3 app/helpers/application_helper.rb
  2. +2 −2 app/helpers/content_helper.rb
@@ -21,19 +21,19 @@ def pluralize(size, zero, one , many )
end
# Produce a link to the permalink_url of 'item'.
- def link_to_permalink(item, title, anchor=nil, style=nil, nofollow=nil)
+ def link_to_permalink(item, title, anchor=nil, style=nil, nofollow=nil, only_path=false)
options = {}
options[:class] = style if style
options[:rel] = "nofollow" if nofollow
- link_to title, item.permalink_url(anchor), options
+ link_to title, item.permalink_url(anchor,only_path), options
end
# The '5 comments' link from the bottom of articles
def comments_link(article)
comment_count = article.published_comments.size
# FIXME Why using own pluralize metchod when the Localize._ provides the same funciotnality, but better? (by simply calling _('%d comments', comment_count) and using the en translation: l.store "%d comments", ["No nomments", "1 comment", "%d comments"])
- link_to_permalink(article,pluralize(comment_count, _('no comments'), _('1 comment'), _('%d comments', comment_count)),'comments')
+ link_to_permalink(article,pluralize(comment_count, _('no comments'), _('1 comment'), _('%d comments', comment_count)),'comments', nil, nil, true)
end
def avatar_tag(options = {})
@@ -1,11 +1,11 @@
require 'digest/sha1'
module ContentHelper
def category_links(article, prefix="Posted in")
- _(prefix) + " " + article.categories.map { |c| link_to h(c.name), category_url(c), :rel => 'tag'}.join(", ")
+ _(prefix) + " " + article.categories.map { |c| link_to h(c.name), c.permalink_url(nil, true), :rel => 'tag'}.join(", ")
end
def tag_links(article, prefix="Tags")
- _(prefix) + " " + article.tags.map { |tag| link_to tag.display_name, tag.permalink_url, :rel => "tag"}.sort.join(", ")
+ _(prefix) + " " + article.tags.map { |tag| link_to tag.display_name, tag.permalink_url(nil, true), :rel => "tag"}.sort.join(", ")
end
def next_link(article, prefix="")

0 comments on commit 3bff4ad

Please sign in to comment.