Add ?include_raw parameter to topic views

This commit is contained in:
riking 2014-11-01 14:30:08 -07:00
parent 9d43e0ae0c
commit 6a946712b3
2 changed files with 2 additions and 1 deletions

View File

@ -441,7 +441,7 @@ class TopicsController < ApplicationController
end
def perform_show_response
topic_view_serializer = TopicViewSerializer.new(@topic_view, scope: guardian, root: false)
topic_view_serializer = TopicViewSerializer.new(@topic_view, scope: guardian, root: false, include_raw: !!params[:include_raw])
respond_to do |format|
format.html do

View File

@ -21,6 +21,7 @@ module PostStreamSerializerMixin
object.posts.each_with_index do |p, idx|
highest_number_in_posts = p.post_number if p.post_number > highest_number_in_posts
ps = PostSerializer.new(p, scope: scope, root: false)
ps.add_raw = true if @options[:include_raw]
ps.topic_view = object
p.topic = object.topic