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

How can i show only one item?

I have a chat on action cable. I change my show action for this: def show @rooms = Room.all render 'index' if @room = Room.find(params[:id]) else render 'new' end end But i need to show to user a single room with another information.…
-1
votes
1 answer

Rails 5 message app wan't show chatroom messages unless reloaded

I'm doing tutorial on message_me app but messages I write and hit enterwan't show up on index chatroom page unless I reload the page. I've tried with two browsers Firefox and Chromium and both consoles show me the error in same file and same line:…
Citizen
  • 11
  • 4
-1
votes
3 answers

Adding enter in inputarea text dynamically

I have one script where I want to add Return when shift+enter is pressed, it is working fine with single Enter, but it is not adding shift+Enter with \n due to error of javascript is not selecting exact content. I am getting following…
Kamal Panhwar
  • 2,345
  • 3
  • 21
  • 37
-1
votes
1 answer

Rails 5: ActionCable doesn't save messages into db

I'm currently facing the issue that my messages aren't saved into the database. I thought to problem would lie within in my setup, since I use sqlite3. But there must be something else... When I start my server the command prompt says…
klasarn
  • 129
  • 1
  • 12
-1
votes
1 answer

My ActionCable doesn't stream data

I have a problem with actioncable. I have two channels ( Notification and Post) but only Notification stream data to received method and not Post . PostChannel look like this => class PostChannel < ApplicationCable::Channel def subscribed …
-2
votes
2 answers

How to get IDs of models subscribed to via a specific channel

How do I get a list of all ActiveRecord models currently subscribed to via a specific ActionCable Channel?
Favourite Onwuemene
  • 4,247
  • 8
  • 28
  • 46
-2
votes
1 answer

Action Cable for notification in each namespace in rails

My project has three namespaces: Trainee, Trainer, and Manager. I use three templates for each namespace. I use action cable for notification (which uses websocket) in the project. Each namespace has different notification. How can I create a…
Trần Hồng
  • 91
  • 2
  • 10
-2
votes
1 answer

How to send some realtime logs to rails view?

I have a rails service that process some job. I want to send logs to view so user knows the current state of the process. The view will have status indicator and log container. Here's a sample view Status: Running **LOGS** 2017-02-27 10:00:00 -…
Jurot King
  • 79
  • 7
-2
votes
1 answer

Rails - getting a correct class from jQuery for Paperclip

I'm trying to get the PaperClip params by using jQuery and create an image directly. i did something like imageData = new FormData(); imageData.append('image', $('input[type=file]')[0].files[0]); and I passed the imageData to a ruby function like …
Brian Law
  • 460
  • 1
  • 4
  • 18
1 2 3
56
57