Skip to content
This repository has been archived by the owner on May 25, 2018. It is now read-only.

Can not configure model observer #49

Open
sanzstez opened this issue Jul 15, 2013 · 1 comment
Open

Can not configure model observer #49

sanzstez opened this issue Jul 15, 2013 · 1 comment

Comments

@sanzstez
Copy link

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...

@melanoma
Copy link

hi, did you ever get around this? thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants