Hello. I am trying to make an applications with faye-rails 1.0.7. (with model observers)
I created observer controller RealtimePublicationsController (in app/realtime) with:
observe Publication, :after_create do |publication|
RealtimePublicationsController.publish('/publications', "OK")
end
Some test clientside JS code:
client = new Faye.Client('/faye')
client.subscribe '/publications', (payload)->
console.log "Client subscribe"
Route.rb:
resources :publications
faye_server '/faye', timeout: 25 do
map '/publications' => RealtimePublicationsController
map default: :block
end
After that i start console and write Publication.create({:title => "test"}), and ... get nothing in browser console.
What i am doing wrong? Help, please...
Hello. I am trying to make an applications with faye-rails 1.0.7. (with model observers)
I created observer controller RealtimePublicationsController (in app/realtime) with:
Some test clientside JS code:
Route.rb:
After that i start console and write Publication.create({:title => "test"}), and ... get nothing in browser console. What i am doing wrong? Help, please...