嗨,我有一個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