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

Rails: Action cable stream_from

I try to stream the current_user.id, but I get only id = 1... class NotificationsChannel < ApplicationCable::Channel def subscribed stream_from "notification:#{current_user.id}" end end Console Log NotificationsChannel is transmitting the…
Mr McDonald
  • 453
  • 7
  • 16
0
votes
1 answer

How to update or refresh table using Rails Actioncable?

My action cable is working fine, it shows me an alert with the data content(although it shows in all the pages). This is my case: an user with role ADMIN has access to an url (http://localhost:3000/ventas/) with a table (html id=tablaventas)that…
matQ
  • 597
  • 2
  • 13
  • 27
0
votes
1 answer

Rails 5 Actioncable not showing new records

I trying to get action cable working. So I created a simple app with model Division with attribute name. index.html.erb

<%= notice %>

<% content_for(:page_header) {"DIVISIONS"} %>
catmal
  • 1,728
  • 1
  • 16
  • 32
0
votes
1 answer

How to deploy action cable on heroku?

Hi i have implemented action cable using rails 5. its working fine locally but its not working on heroku. on heroku whenever i send any message it sends four messages, two duplicates and 2 blank messages. here is my code :- conversation.js …
awsm sid
  • 595
  • 11
  • 28
0
votes
0 answers

Rails ActionCable with http authentification

I have RoR 5.0.0.1 project with ActionCable functionality. We have staging environmen with http authentification. I need ActionCable to work with our staging. What I need to do to get work ActionCable and http auth in our project? My current…
Matho
  • 125
  • 2
  • 11
0
votes
1 answer

Rails 5 Action Cable Not Working

I've looked at multiple tutorials and cannot seem to receive notifications from action cable when I create a new Message record. All I am trying to do is print out the response in the console just so I know it works. I've installed redis but still…
Cannon Moyer
  • 3,014
  • 3
  • 31
  • 75
0
votes
1 answer

Keeping Rails data updated from Websocket without saving to database

I have websocket price data streaming in to my rails api app which I want to keep updated so any api requests get an updated response. It would be too expensive to save each update to the database. How can I do this? In Ember I can modify the model…
Joshua Jenkins
  • 315
  • 1
  • 15
0
votes
1 answer

How to test ActionCable with Capybara and poltergeist inside Docker?

I need to test ActionCable functionality inside a dockerized rails app, running JS tests with Poltergeist (PhantomJS). I've tried selenium-webdriver, chromedriver, headless chrome... nothing works. And of course, setting Puma as the Capybara server.
0
votes
1 answer

Rails 5, action-cable, docker and nginx

This question has been asked many times but I am not able to figure out problem even after trying all solutions. I am getting [a9736d85-6b19-425f-b9b0-50070ad6ca5f] Started GET "/api/v1/notifications/"[non-WebSocket] for 172.18.0.8 at 2017-10-16…
0
votes
0 answers

Rails ActionCable connecting to normal websocket

I want to access data from a websocket stream. I can't get ActionCable to bind the message received function. If I hack cable.js then I can see the data by adding: App.cable =…
Joshua Jenkins
  • 315
  • 1
  • 15
0
votes
1 answer

rails: javascript/jQuery callbacks are triggered twice

Rails version 5.1.3 Specifically, it's the code in assets/javascripts/channels/my_channel.coffee where channel js client code lives, with other general js code. I'm using actioncable. But general jQuery/javascript callbacks suffer from this, too.…
Xiaohong Deng
  • 135
  • 2
  • 12
0
votes
1 answer

Is there a way to add a temporary username to action cable chat box

Hello I have a basic chat room set up on action cable and was wondering whether there was a way to give the current user a temporary username while posting in the chat room? preferably set up so they have to type their username In before they are…
dave
  • 15
  • 1
  • 4
0
votes
1 answer

How to conditionally append placeholder img or avatar with ActionCable

I'm currently working on a way to add the user avatar to ActionCable chatroom posts. I made some progress with regards to getting the message to insert after changing the coffee script code to support the user.user_profile.avatar.profile_thumb…
Johnny C
  • 121
  • 1
  • 1
  • 11
0
votes
1 answer

ActionCable: Meaning of delegate in Ruby on Rails documentation

In the documentation, Connection section of Ruby on Rails Guide on Action Cable , the word 'delegate' is used and I don't know what they mean. Here's the code they are referring to in the section: #…
heretoinfinity
  • 1,528
  • 3
  • 14
  • 33
0
votes
1 answer

Rails and ActionCable. Every message comes multiply times

Env: Rails 5.0.5 Redis server v=4.0.1 There is nothing special on the server side. The problem is that a user have many pings for the same message (duplicates?). Redis.new(url: 'redis://:auth@ip:port/db_number').pubsub('channels',…
Evmorov
  • 1,134
  • 22
  • 28