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
1 answer

ActionCable not respecting port assigning in production.rb

I'm trying to run my ActionCable server on an alternative port (8080). I set up my production.rb as follows: config.action_cable.url = 'wss://my-domain.org:8080/cable' config.web_socket_server_url = "wss://my-domain.org:8080/cable" The metatags…
D-Nice
  • 4,772
  • 14
  • 52
  • 86
0
votes
1 answer

React - Rails 5 Action Cable

I've tried multiple things now but i cannot seem to get messages to be broadcasted to the clients. In this application, i got a react component that does the channel subscription. My console output for application connected is showing up in my log…
KoU_warch
  • 2,160
  • 1
  • 25
  • 46
0
votes
1 answer

How to change the value of a prop (or data) of a component, from OUTSIDE the component?

As the title says, I'm trying to change the value of a prop/data in a component, but the trigger is being fired from outside the component, from something that has nothing to do with Vuejs. Currently I trying to use a Simple State Manager, based on…
dev404
  • 1,088
  • 13
  • 34
0
votes
1 answer

What is default behavior for actioncable in rails?

When generating a new channel, there is commented out stream_from method call. I understand, that it suits for recognizing streams, like stream_from "comments_#{message.id}". But if this channel has no such goal and should stream all comments? What…
Molfar
  • 1,411
  • 3
  • 18
  • 49
0
votes
1 answer

How to run a method and output while a user types in an input box?

I have an online tool, I have built with rails that takes a user input and output the result on the same page upon clicking a button. Upon clicking the button a complex code runs on the input and shows the result. How can I make the result appears…
Postscripter
  • 521
  • 7
  • 18
0
votes
1 answer

Action Cable --get all online Pub/Sub?

How to get all online consumers (publishers / subscribers) who is currently streaming on specific channel ?
Rana
  • 81
  • 1
  • 1
  • 8
0
votes
1 answer

How do you test ActionCable with Capybara?

I tried this solution https://gist.github.com/alexeyrazuvaev/98448c9935352fac5ee96e139bc3bd72 and it doesn't work with my test. Tried reproducing it in the browser and it works as expected. I can't figure out what's the problem with my test. This…
gbertl
  • 321
  • 2
  • 16
0
votes
1 answer

Group chat app with ActionCable gives error ActionController::InvalidAuthenticityToken

I have been trying to get around an error I don't really understand. How can there be an Invalid Authenticity Token error? This is the error on the Terminal: Started GET "/serviceworker.js" for 127.0.0.1 at 2018-01-16 17:16:46…
0
votes
0 answers

Detecting wake from sleep on phone browser with Javascript

I'm working on a Ruby on Rails application with Action Cable. Watching the logs, I've noticed that when I put my phone to sleep that the WebSocket is closed automatically, so further updates are not received. However, on wake (directly to the page,…
El Tea
  • 1,206
  • 12
  • 21
0
votes
1 answer

How retrieve session store from inside ActionCable::Connection::Base

From action cable documentation I read this example for setting current_user: module ApplicationCable class Connection < ActionCable::Connection::Base identified_by :current_user def connect self.current_user = find_verified_user …
0
votes
3 answers

Rails ActionCable & Partials

Action Cable is configured to correctly to subscribe, broadcast, etc. However, I'm getting the behavior of user avatars rendering on the wrong side due to a Rails partial. # conversations/_message.html.erb <% if current_user.id == message.user_id…
PrimeTimeTran
  • 1,807
  • 2
  • 17
  • 29
0
votes
1 answer

Rails 5.1 - ActionCable not updating?

When i try to post an comment with ActionCable, everything works, however, i always have to refresh the page to see the comment itself get rendered. Any ideas whats wrong? Tried to restart the server, logout, login etc. But nothing really helped.…
0
votes
2 answers

I can't register for devise in rails

I can't register, only login, In the server i see this: An unauthorized connection attempt was rejected Failed to upgrade to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: keep-alive, Upgrade, HTTP_UPGRADE: websocket) class Connection <…
frtgu34
  • 99
  • 9
0
votes
1 answer

Agile Web Development with Rails 5 - Action Cable

I'm working through the ActionCable example within the book. All of the code is added as described and I can see the ActionCable server log hit but the updating page never updates the cost of the item. What am I missing? The following log entry…
Aaron Lind
  • 405
  • 1
  • 6
  • 16
0
votes
0 answers

Rails 5 Action Cable not working in Google Cloud (VM)

I am using rails 5 for actioncable. I have developed and tested application with actioncable on my local machine (in development environment). The real time notification work perfectly until I try to deploy the code to virtual machine on Google…