Module: TopicListResponder
- Included in:
- ListController, TagsController
- Defined in:
- lib/topic_list_responder.rb
Overview
Helps us respond with a topic list from a controller
Instance Method Summary collapse
Instance Method Details
#respond_with_list(list) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/topic_list_responder.rb', line 5 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" end format.json { render_serialized(list, TopicListSerializer) } end end |