Skip to content

Instantly share code, notes, and snippets.

@k-akimoto
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k-akimoto/9664140 to your computer and use it in GitHub Desktop.
Save k-akimoto/9664140 to your computer and use it in GitHub Desktop.
20140320 blog用
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
WebsocketRails::EventMap.describe do
subscribe :new_message, to: ChatController, with_method: :new_message
end
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