faye-rails
faye-rails copied to clipboard
Routes file seemingly not working
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?
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.
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.