I think you're asking the wrong question
Turbolinks is meant for when you're switching between views -- it helps limit the number of requests made to the server:
Turbolinks makes following links in your web application faster.
Instead of letting the browser recompile the JavaScript and CSS
between each page change, it keeps the current page instance alive and
replaces only the body and the title in the head
Polling
What you're really looking for is "live" functionality:
- Ajax Polling (typically with SSE's)
- WebSockets
Rails runs on the HTTP structure, meaning you send a request, it replies. The problem is this prohibits Rails from generating a request from server side. Technology such as ActionController::Live has been created to remedy this, but it's sketchy
I'd recommend using a service called Pusher
This is pub/sub tech, works by giving you an eventListener
in your JS, basically "listening" to any updates from your server. You can then publish the updates through Rails' Pusher gem:
#app/assets/javascripts/application.js.coffee
pusher = new Pusher("*************", cluster: 'eu')
channel = pusher.subscribe("private-user-#{gon.user}")
channel.bind "multi_destroy", (data) ->
# do your stuff here
#app/controllers/message.rb
def send_message
public_key = self.user.public_key
Pusher['private-user-' + public_key].trigger('message_sent', {
message: "Message Sent"
})
end