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.
On 22 Jun 2009, at 11:32, Nash wrote:
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 C. 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.
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.
Max W. wrote:
script/generate model user_id:integer utterance:string
Oops, that should have been
script/generate model Message user_id:integer utterance:string