discourse/lib/topic_list_responder.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
505 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
2015-01-08 16:44:27 -05:00
# Helps us respond with a topic list from a controller
module TopicListResponder
def respond_with_list(list)
discourse_expires_in 1.minute
respond_to do |format|
format.html do
@list = list
store_preloaded(
list.preload_key,
MultiJson.dump(TopicListSerializer.new(list, scope: guardian)),
)
render "list/list"
2015-01-08 16:44:27 -05:00
end
format.json { render_serialized(list, TopicListSerializer) }
end
end
end