Undefined method `model' for ContactController:Class


#1

Hi ,

I’m getting “undefined method `model’ for ContactController:Class”
Basically this is my first RoR application.
Can you please somebody help to resolve this.
Steps I have followed,
1)ruby script/generate model contact
2)ruby script/generate controller contact
3) vim app/controllers/contact_controller.rb
class ContactController < ApplicationController
model :contact
scaffold :contact
end
4)ruby script/server -p 9090

Actually I need to create/select/update table thru RoR.

Advance Thanks,
Sankar.


#2

leave out the line
model :contact
you don’t need that.


#3

MaD wrote:

leave out the line
model :contact
you don’t need that.

I have remove that … Now I’m getting error like “undefined method
`scaffold’ for ContactController:Class”

I think i’m totally wrong … Can you pls let me know the step to
prepare small application ?


#4

On 24 Feb 2009, at 15:39, Sankar K. wrote:

prepare small application ?
Sounds like you’re trying to do an out of date tutorial. You will
probably save yourself some frustration by picking a more up to date
one.

Fred


#5

sorry i didn’t read carefully enough.

try this:
rails project
cd project
script/generate scaffold contact name:string street:string
mail:string
nano config/database.yml
rake db:migrate
script/server
firefox http://localhost:3000/contacts/new

hope this helps.

btw: the tutorial you are following seems outdated (pre rails 2.0)


#6

MaD wrote:

sorry i didn’t read carefully enough.

try this:
rails project
cd project
script/generate scaffold contact name:string street:string
mail:string
nano config/database.yml
rake db:migrate
script/server
firefox http://localhost:3000/contacts/new

hope this helps.

btw: the tutorial you are following seems outdated (pre rails 2.0)

Thanks a lot . Thank you so much … Now I’m able to do
create/select/update table…