Rails3 路由问题:未定义的方法“资源" [英] Rails3 routes problem: undefined method `resources'

查看:44
本文介绍了Rails3 路由问题:未定义的方法“资源"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 Rails 3.0.3 版,现在我的 routes.rb 文件有问题.

I have installed Rails version 3.0.3, and now I have problems with my routes.rb file.

routes.rb:1: undefined method `resources' for main:Object (NoMethodError)

问题出在哪里?

resources :plains

这就是我的routes.rb

推荐答案

如果这是 routes.rb 的全部,你需要在它周围添加一个块:

If that's the entirety of routes.rb, you'll need to add a block around it:

MyAppName::Application.routes.draw do
   resources :plains
end

这篇关于Rails3 路由问题:未定义的方法“资源"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆