ruby - conflict between websocket url and routes in rails -
dear of master in rails
i new in developing web app using rails. now, want try create app rails using web socket. tutorial here however, when improve experience in rails. conflict between url websocket , url created in routes.rb in routes.rb
get ':username' => 'users#profile', as:"profile"
the url conflict url web socket , then, web app websocket getting failure. me solve problem..???
thanks
i fixed using routing constraint:
get '/:hash', to: 'conversations#show', constraints: {hash: /((?!websocket).)*/}
the route not work unless :hash
not contain string "websocket"
i'm sure there's better regex out there, , if hash ever randomly contains string "websocket" it'll fail.
but, fixes problem me in development.
Comments
Post a Comment