Refactoring our channels away from the index

We have our WebSockets running on the index page for our Polls, but that'll actually be very difficult for us to support in the future, especially if we want to add anything like per-poll chat options or another similar feature that relies very specifically on the display of a single poll. Because of that, let's take a few minutes to implement a show action and template for our poll, and move our socket code there instead! We'll also have to change some of the topics that we were previously relying on since right now we're using the lobby as the identifier for the polls channels. We'll instead want to switch that over to be more along the lines of: "polls:(poll id)". First, hop on over to lib/vocial_web/router.ex ...

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.