I'm almost completely new to Rails, or I'm sure I know how to answer this question myself. I'm just trying to change the main chat application created in the main ActionCable demo: https://medium.com/@dhh/rails-5-action-cable-demo-8bba4ccfc55e#.6lmd6tfi7
Instead of having only one chat, I want to have several chats, so I changed my routes.rb by adding this line:
get '/rooms/show/:topic', to: 'rooms#show'
So now I can attend different chats based on different topics. The room controller in /app/controllers/rooms_controller.rb can handle these routes without problems:
class RoomsController < ApplicationController def show @topic = params[:topic] @messages = Message.all end end
But this parameter is not passed to app/channels/room_channel.rb , and I just donโt know what changes I need to make. My current attempt:
class RoomChannel < ApplicationCable::Channel def subscribed stream_from "room_channel_
returns "room_channel _"
source share