How to trigger rails post method from faye.ru file (using faye)

so i am using faye pub-sub in my application, publish is happening from different application, in my faye.js i have written ajax post method for rails. now if 5 pages of my application is opened in browser, faye.js is loaded 5 times and post method is called 5 times. if not a single page is opened, post method wont work even once. however i am receiving published data in faye server. so is there a way of calling rails post method in faye.ru file when i use callback method.
This is my faye.ru

require 'faye'

require File.expand_path('../config/initializers/faye_token.rb', __FILE__)

Faye::WebSocket.load_adapter('thin')
Faye.logger = Logger.new(STDOUT)

class ServerAuth
  def incoming(message, callback)
    if message['channel'] !~ %r{^/meta/}
      if message['ext']['auth_token'] != ENV['FAYE_TOKEN']
        message['error'] = 'Invalid authentication token'
      end
    end
    callback.call(message)
  end

  # IMPORTANT: clear out the auth token so it is not leaked to the client
  def outgoing(message, callback)
    if message['ext'] && message['ext']['auth_token']
      message['ext'] = {} 
    end
    callback.call(message)
  end
end

$bayeux = Faye::RackAdapter.new(:mount => '/faye', :timeout => 25)

$bayeux.add_extension(ServerAuth.new)

run $bayeux

and my faye.js

$(function() {
  var faye = new Faye.Client('http://localhost:9292/faye');
faye.subscribe("/functional", function(data) {
    ajax_call(data);
  });
});


Source: stackoverflow-javascript