0

因此,当我尝试在 rails 中调出 rhtml 页面时,出现 500 服务器错误。当我启动 WEBrick 服务器时,我会欢迎来到 rails 主页。该应用程序的名称是你好。我从命令行生成了控制器,它看起来像

class HelloController < ApplicationController
def there
end
end

我在views/hello/there.rhtml中有我的观点(there.rhtml)。但是http://localhost:3000/hello/there出现 500 服务器错误。我目前正在一个 vista 盒子上运行它。有任何想法吗?

4

2 回答 2

1

你确定路线了吗?它在 routes.rb 中定义。您也可以尝试检查开发日志以查看究竟是什么问题。

于 2010-07-05T14:11:12.090 回答
1

可以发布错误日志消息吗?正如 Nm 建议的那样,这可能是一个路由问题,如果尝试在 routes.rb 文件中添加此路由

map.connect '/hello/there', :controller => 'hello', :action => 'there'
于 2010-07-05T14:45:16.813 回答