make 'link' on comments use very short url

This commit is contained in:
joshua stein 2016-03-24 13:19:26 -05:00
commit d54427df21
2 changed files with 4 additions and 4 deletions

View file

@ -114,7 +114,7 @@ class Comment < ActiveRecord::Base
def as_json(options = {})
h = [
:short_id,
{ :short_id_url => Rails.application.root_url + "c/#{self.short_id}" },
:short_id_url,
:created_at,
:updated_at,
:is_deleted,
@ -392,11 +392,11 @@ class Comment < ActiveRecord::Base
end
def short_id_path
self.story.short_id_path + "/_/comments/#{self.short_id}#c_#{self.short_id}"
self.story.short_id_path + "/c/#{self.short_id}"
end
def short_id_url
self.story.short_id_url + "/_/comments/#{self.short_id}#c_#{self.short_id}"
Rails.application.root_url + "c/#{self.short_id}"
end
def to_param

View file

@ -63,7 +63,7 @@ class="comment <%= comment.current_vote ? (comment.current_vote[:vote] == 1 ?
<% if !comment.previewing %>
|
<a href="<%= comment.url %>">link</a>
<a href="<%= comment.short_id_url %>">link</a>
<% if comment.is_editable_by_user?(@user) %>
|