Explicitly specify the routing we want on route.rb
post ‘gamelobbies/leave’, to: ‘gamelobbies#leave’
Implementation of Pusher
A lot of testing
Pusher channels and events workflow
Draw out the possible workflow, including what channel and events to subscribe or unsubscribe, on a piece of paper first, then code the workflow
Heroku
CSS / Javascript does not work the same way as localhost
RAILS_ENV=production rake asset:precompile before pushing to Heroku
10 of 10
Solution (Continue)
Communication between server and clients
Chat messages we use an open source library, and modify the source code based on what we need (i.e modify its Javascript file so the chat window and minimize and position at the bottom right, and expand if it is not in minimized state
Lobby, game room, and game session real time updates
Use Ajax POST to send updates from client to server, then let server broadcast out to other clients
Reason:
Avoid clients to be authenticated
It is mentioned in the Pusher documentation
The Ajax request to the server will have a callback from the server with data about which view to render