Allowing users to vote on polls

We currently don't have any code in place that will actually allow anonymous users to vote, even outside of our socket code, so that's something we'll want to add in first. The reason that we're going to write in some non-socket code for voting is that everything WebSocket-based should generally have some way of manually performing whatever operations it is performing. That way the testing of your application is a little bit simpler and it also makes it easier for you to support older browsers and not just lock someone out of your application entirely.

First, we'll need to add the new route to be able to support voting on individual options. We'll make our own lives easier here by avoiding a complicated nested ...

Get Phoenix Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.