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 show a list of sales. This table must be automatically refreshed every time a user (role SELLER) inserts a new sale in the database.
This user with role seller has an url (http://localhost:3000/ventas/new) with a form where insert new sales to the database. The Actioncable implementation is working okay, but I have two problems:
1- how to refresh the table from the ventas.coffee:
//here i am stuck
received: (data) ->
alert data.name //this works ok
//...AND HERE I WANT TO UPDATE or refresh THE ADMIN TABLE
2- Also, how can I show for example the alert message only to the admin specific view? in this case only in the view ventas/index.html.erb.