I have a javascript code block in my application.html.erb [view file] which receives an event from external api. all i want to do is when the event is recieved in the javascript code block i need to execute a helper method inside [application_helper.rb].
I have gone through most of te stacks in here but could not find any relevant answer.
the javascript code block looks like this:
var pusher = new Pusher('b00c9657a0a896f3ec26');
var channel = pusher.subscribe('NewOrders');
channel.bind('NewOrderArrived', function(data) {
[ I NEED TO CALL THE RAILS HELPER METHOD HERE ]
console.log("got u")
});