Jump to content

The ultimate community for Ruby on Rails developers.


Ask: Help me solving the problem about web socket

websocket routes

  • Please log in to reply
No replies to this topic

#1 microdevil



  • Members
  • 1 posts
  • LocationJakarta

Posted 28 June 2014 - 11:21 AM

up vote 0 down vote favorite

I create web app in rails using websocket. I create add bellow in routes.rb

get '/:username' => 'users#profile', as:"profile"



after this, i add bellow in Gemfile

gem 'websocket-rails'



and then i add bellow in application.js

var dispatcher = new WebSocketRails('localhost:3000/websocket');
channel = dispatcher.subscribe('articles');
channel.bind('new', function(article) {
console.log('a new article about '+article.id+' arrived!');



The problem is

localhost:3000/websocket =====> run profile_path (get '/:username' => 'users#profile', as:"profile")



anyone could help me to solve my websocket problem without removing { get '/:username' => 'users#profile', as:"profile" }..??


i am new user in developing rails using web socket.



Also tagged with one or more of these keywords: websocket, routes

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users