1
을 loadibng 동안 연결이 나는 PubSub 여기PubSub 페이지가 오류
ul.questions_list
-if(@questions.empty?)
|no questions available
-else
[email protected] do|question|
li
=link_to"#{ question.title } ", question_path(question)
p= link_to 'Ask question', new_question_path
= subscribe_to '/questions'
을 구독이 중단 된 후 커피
$ ->
PrivatePub.subscribe '/questions', (data, channel) ->
question = $.parseJSON(data['question'])
console.log(question.title)
$('.questions_list').append("<li><a href='/questions/#{question.id}'>#{question.title}</a></li>");
그리고 컨트롤러 (이 경우 CONSOLE.LOG에 잘 데이터를 제공) 간다
def create
@question = Question.new(question_params)
@question.user = current_user
if @question.save
PrivatePub.publish_to '/questions', question: @question.to_json
redirect_to @question, notice: 'Your question successfully created.'
else
render :new
end
end
나는 그런 오류를받을
The connection to ws://localhost:9292/faye was interruped while the page was loading.
...et;t.exports={create:function(t){return **new** n(t)}}}).call(e.function(){return th...)
나는 어디서 잘못했는지 이해하지 못합니다. 어떤 도움을 주셔서 감사합니다