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)
Where the problem can be?
resources :plains
That's all in my routes.rb
Given a routes file like this:
MyApp::Application.routes.draw do
# Put resources here
end
You need to declare your resources inside that block, is that what you've done?
Your error saying resources is not a member of object, which leads me to believe you've made that declaration outside this block, as inside this block, you're in the scope of the app's routes, and resources is a method of that object.
Full code post would help though.
edit given that the error is on line 1 of that file, this is definitely what you've done, place it in the block
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With