简体   繁体   English

全新安装后的Rails路由错误

[英]Rails routing error after fresh install

I just installed Rails, etc. on a Windows 7 machine. 我刚刚在Windows 7计算机上安装了Rails等。

Created my first app, and am trying to go to the first generated and this is what I get: 创建了我的第一个应用程序,并尝试转到第一个生成的应用程序,这是我得到的:

Routing Error

No route matches "/say/hello"

Where say is the app name, and hello is the name of the first view. 其中say是应用程序名称,hello是第一个视图的名称。

Thoughts? 有什么想法吗?

If you're implementing very simple routes (and since this is your first app, I'm assuming that's what you want!), make sure you've un-commented the last route in routes.rb: 如果您要实现非常简单的路由(并且由于这是您的第一个应用程序,那么我假设这就是您想要的!),请确保您未注释routes.rb中的最后一条路由:

match ':controller(/:action(/:id(.:format)))'

This will send /say/hello to the hello action of the say controller. 这会将/ say / hello发送到say控制器的hello动作。

您是否在config/routes.rb添加了route?

get 'say#hello'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM