나는 인덱스 페이지를로드하려고하면이 오류가 계속 : 나는 ApplicationController
와 BaseController
를 교체 할 경우웹 소켓 클래스
NoMethodError in MessageController#new_message
undefined method `action' for MessageController:Class
오류가 사라질를, 하지만 이것 역시 많은 것들을 망가 뜨리고 rails-websocket을위한 튜토리얼 (http://websocket-rails.github.io/)은 BaseController
으로되어 있습니다.
class MessageController < WebsocketRails::BaseController
def initialize_session
# perform application setup here
controller_store[:message_count] = 0
end
def new_message
new_message = {:message => 'this is a message'}
send_message :new_message, new_message
end
def index
end
end
누구에게 어떤 문제가 있는지 알고 있습니까?
- 편집 사용하여 레일 버전 4.0.2 그 모든
어떻게 액세스하고 있습니까? –
비슷한 문제가 있습니다. WebsocketRails :: BaseController에 대한 다른 컨트롤러를 사용하여 websocket 이벤트를 처리했습니다. 인덱스, 생성 등의 경로와 관련이 있다고 생각합니다. WebsocketRails :: BaseController가 라우트 요청을 처리 할 수 없다고 생각합니다. 그리고 아마 당신이 제공 한 참조 링크에있는'create '는 실제로'create'하지만 실제로 REST 메서드는 아닙니다. 그렇지 않으면, 레일 4.0.2와 호환되지 않을 수도 있고, 버그 일 수도 있습니다. 누군가가 대답 할 수 있기를 바랍니다. –