Error with Message.find()

I've code http://pastebin.com/m474f7e1d
I get error: uninitialized constant ChatController::Message
it's from http://ruby.inuse.ru/article/ror-razrabotka-chata
Help plz.

I've code http://pastebin.com/m474f7e1d
I get error: uninitialized constant ChatController::Message
it's from http://ruby.inuse.ru/article/ror-razrabotka-chata
Help plz.

To ask the obvious, do you have a Message class in message.rb ?

Fred

Frederick Cheung wrote:

To ask the obvious, do you have a Message class in message.rb ?

Fred

My russian's not good but that element does appear to be missing from
that tutorial. :slight_smile:

Nash - it should look like this:

#message.rb
class Message < ActiveRecord::Base
end

BTW you can make a model and associated migration in one action with

script/generate model user_id:integer utterance:string
rake db:migrate

I took the liberty of changing the 'user' field to 'user_id' which i
suspect it should be since it's presumably a foreign key to the users
table.