faye-rails icon indicating copy to clipboard operation
faye-rails copied to clipboard

Routes file seemingly not working

Open paterson opened this issue 11 years ago • 2 comments

Hi,

I've the following in my routes.rb:

faye_server '/faye', timeout: 25 do
  map '/find/*' => ApiController
end

and then I've the api controller as follows (snippet):

class ApiController < FayeRails::Controller
  channel '/find/*' do
    subscribe do
      Rails.logger.debug "In Subscribe"
      ...
      ApiController.publish(channel, some_other_data)
    end
  end
end

I'm connecting fine, but any publish function client side to say /faye/find/1 just returns the data posted with it, and the debug call there never happens.

I've tried removing the the wildcard and replacing it with a fixed integer like 1, still the same. Is there something I'm missing? Terminal isn't complaining and since it connects fine and does echo back, I'm pretty sure its mostly correct, any ideas?

paterson avatar May 18 '13 12:05 paterson

Me too have the same issue. I m connecting fine, and I am able to send and receive messages. I have added a MockExtension class, and defined an 'incoming' function that displays the message. Its all working fine. But the mapping of the channel to a controller is not working.

mukesh-rk avatar May 28 '13 04:05 mukesh-rk

Now that we're using the middleware-based solution. Can you check out whether it's fixed now, or I could close this issue here.

jimsynz avatar Dec 31 '14 00:12 jimsynz