嗨,我有一个 Rails 应用程序,这是控制器
class StreamsController < ApplicationController
def conversations
stream_responder do
@stream = Stream::Conversations.new(current_user, :max_time => max_time)
@stream_json = PostConversationPresenter.collection_json(@stream.stream_posts, current_user)
end
end
def stream_responder(&block)
yield
respond_to do |format|
format.html do
gon.stream = @stream_json
render :nothing => true, :layout => "post"
end
format.mobile {authenticate_user!; render 'layouts/main_stream' }
format.json {render :json => @stream_json }
end
end
end
我想知道这是什么stream_responder do
意思gon.stream