UX: more permalinks page improvements

This commit is contained in:
Arpit Jalan
2015-07-20 17:40:22 +05:30
parent 80832d0b71
commit c54de7159c
5 changed files with 27 additions and 18 deletions

View File

@ -1,5 +1,5 @@
class PermalinkSerializer < ApplicationSerializer
attributes :id, :url, :topic_id, :topic_title, :topic_url, :post_id, :post_url, :category_id, :category_name, :category_url, :external_url
attributes :id, :url, :topic_id, :topic_title, :topic_url, :post_id, :post_url, :post_number, :post_topic_title, :category_id, :category_name, :category_url, :external_url
def topic_title
object.try(:topic).try(:title)
@ -13,6 +13,14 @@ class PermalinkSerializer < ApplicationSerializer
object.try(:post).try(:url)
end
def post_number
object.try(:post).try(:post_number)
end
def post_topic_title
object.try(:post).try(:topic).try(:title)
end
def category_name
object.try(:category).try(:name)
end