Forum: Ruby on Rails undefined method `model' for ContactController:Class

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sankar K. (Guest)
on 2009-02-24 17:11
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.
MaD (Guest)
on 2009-02-24 17:32
(Received via mailing list)
leave out the line
  model :contact
you don't need that.
Sankar K. (Guest)
on 2009-02-24 17:39
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 ?
MaD (Guest)
on 2009-02-24 18:24
(Received via mailing list)
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)
Frederick C. (Guest)
on 2009-02-24 18:33
(Received via mailing list)
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
Sankar K. (Guest)
on 2009-02-25 05:25
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....
This topic is locked and can not be replied to.