Questions tagged [actioncable]

Action Cable is an open source technology shipped to us with Ruby On Rails 5. It uses websockets instead of traditional HTTP protocol and allows 2-way asynchronious data transfer. The best field of application for ActionCable is chat, single page applications and so on.

The Action Cable source is placed at Github.

To find code examples please check actioncable-examples repository.

849 questions
0
votes
0 answers

ActionCable chat, JS console.log doesn't work

I'm making chat using ActionCable. I'd like to have normal, public rooms, private rooms and direct messages (something like Slack). Public rooms and DMs are working. I can also create private room and add users. But I'd like to have some way to…
Jes
  • 323
  • 2
  • 18
0
votes
0 answers

Rails ActionCable real time notifications for specific user

I'm working on a blog and the idea is to get real-time notifications as soon as somebody writes a comment to one of my posts (like on Facebook or similar social media). I've tried to do this with ActionCable feature and everything seems working, but…
staniel
  • 3
  • 3
0
votes
1 answer

learn enough action cable tutorial not working

I am working on Hartl's tutorial Learn Enough Action Cable, and I'm stuck on section 4.1. I copied and pasted the code from the tutorial just to be sure, and the pop up window with data.content still wont come up. Messages Controller: . . def…
0
votes
1 answer

ActionCable: Detect connection lost on client side, show connection status to user

Is there a way to be notified or detect the state of a websocket connection on the client side of an app? ActionCable already implements a 3 second-period ping from server->client, and there is certainly client-side functionality that uses this ping…
0
votes
1 answer

who received message posted by me

I implemented actioncable for real time messaging, Now I want to know who received the message posted by me. all users are communicating using the same channel class RoomChannel < ApplicationCable::Channel def subscribed stream_from…
ashvin
  • 2,020
  • 1
  • 16
  • 33
0
votes
0 answers

Rails 5 with Redis pubsub - after a while broadcast messages are not transmitted to clients

I'm facing a weird issue. I have created an ActionCable controller to allow simplistic chat rooms. When everything works, log messages show the transmitting message upon calling broadcast_to. 2017-03-05T10:29:21.624294+00:00 app[web.1]: I,…
Alon Burg
  • 2,500
  • 2
  • 27
  • 32
0
votes
1 answer

Rails 5 Action cable is not working

I have created a vew as show.html.erb where there is a list of checkboxes are present I want when a checkbox is cliked a action named as Generate is perform and then render a partial inside that show.html.erb I tried using Action cable but unable to…
Amitoj Singh
  • 121
  • 1
  • 1
  • 7
0
votes
1 answer

Rails 5 ActionCable Works using DIV, but not UL

I have created a WebSocket messaging feature using Rails 5 ActionCable. It works great when I use a DIV as the container. But when I changed it to use a UL and LI instead; it stopped working. I cant seem to debug this; but it looks like the…
Ash
  • 24,276
  • 34
  • 107
  • 152
0
votes
1 answer

Rails | show url parameters on show page after create

I added the URL parameters to the new.html.erb page by a link_to <%= link_to 'Message', new_personal_message_path(receiver_id: 1010) %> which correctly to displayed in the URL as example.com/personal_messages/new?receiver_id=1010 and i was able…
Raidspec
  • 652
  • 1
  • 6
  • 13
0
votes
1 answer

How to lock actioncable chat to admins only?

Hello Guys thank you for taking the time to check out my question. So to explain a bit as the title might not do the question justice, I would like to learn the best way i can go about setting a method that checks for role and if it's admin then go…
EVX
  • 304
  • 4
  • 17
0
votes
1 answer

ActionCable send message on page load

I want to send message to ActionCable server on a page load... But ActionCable not connected at that time. How to delay message sending until ActionCable will connect to server?
Brazhnyk Yuriy
  • 464
  • 4
  • 10
0
votes
1 answer

how to access lower channel using Actioncable client?

I am using this action cable library https://github.com/hosopy/actioncable-client-java in an Android app, I have been able to make a connection with the top channel. However, I cannot seem to access lower channels. This is how my endpoint looks…
Youngdev
  • 49
  • 1
  • 10
0
votes
1 answer

Are ActionCable Channels instances shared across clients?

I identify connections by public IP address. My understanding until recently (doubting it) is that in such a case, client's subscribing to a channel would reuse the same Channel instance. A real world example is as follows: I'm building up an app…
42linoge
  • 26
  • 5
0
votes
1 answer

ActionCable displaying message in multiple channels

I am implementing with ActionCable a chat inside my game room (game). Here is my code so far: app/channels/game_channel.rb: class GameChannel < ApplicationCable::Channel def subscribed stream_from "game_channel_#{params[:game]}" end def…
Felipe Maion
  • 336
  • 1
  • 12
0
votes
1 answer

DOMstringMap for ApplicationChannel

I'm making a Chat App using ActionCable and websocket. But I cannot get room_id in asset/javascripts/channels/rooms.coffee I want to get it like messages.data('room-id') could you tell me the…
yosumkty
  • 11
  • 1