Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails 6.1.3没有匹配的路由[GET]_Ruby On Rails_Reactjs - Fatal编程技术网

Ruby on rails Rails 6.1.3没有匹配的路由[GET]

Ruby on rails Rails 6.1.3没有匹配的路由[GET],ruby-on-rails,reactjs,Ruby On Rails,Reactjs,我请求的页面实际上是由react创建的,之后它重定向到该页面,但当我刷新页面时,视图为空,我收到路由错误: 没有路线匹配[GET]“/room/473042e0-c8f5-11eb-948f-51083af9da12” 这是我的配置/routes.rb: Rails.application.routes.draw do get "room/:uid" >= "world#index", as: 'room' root 'world#index

我请求的页面实际上是由react创建的,之后它重定向到该页面,但当我刷新页面时,视图为空,我收到路由错误: 没有路线匹配[GET]“/room/473042e0-c8f5-11eb-948f-51083af9da12” 这是我的配置/routes.rb:

Rails.application.routes.draw do
  get "room/:uid" >= "world#index", as: 'room'
  root 'world#index'

  # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end
您有一个输入错误(不是
=
,而是
=>
):


谢谢,我也可以使用
get'room/:uid',to:'world#index',as:'room'
确实可以:)如果这回答了你的问题,请毫不犹豫地验证我的答案:)
get "room/:uid" => "world#index", as: 'room'