Last active
August 29, 2015 13:57
-
-
Save k-akimoto/9664140 to your computer and use it in GitHub Desktop.
20140320 blog用
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChatController < WebsocketRails::BaseController | |
def initialize_session | |
puts "Session Initialized\n" | |
end | |
def new_message | |
# messageという変数が送られてくる | |
puts "call new_message: #{message}" | |
broadcast_message :new_message, message | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WebsocketRails::EventMap.describe do | |
subscribe :new_message, to: ChatController, with_method: :new_message | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PublicController < ApplicationController | |
def index | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment