sbarlow
November 10, 2006, 12:52pm
1
Apologies for simple question.
I am getting the error…
undefined method `of’ for Task:Class
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:1129:in
method_missing' #{RAILS_ROOT}/app/models/task.rb:4 #{RAILS_ROOT}/app/controllers/tasks_controller.rb:12:in
list’
This error occured while loading the following files:
task.rb
I cannot see this error mentioned in the mailing list and googling for
it fails too.
I have a simple model type…
class Task < ActiveRecord::Base
validates_presence of :name
end
defined in the file task.rb and a database table ‘tasks’ and a
scaffolding generated controller called ‘tasks_controller.rb’. The
index method of the controller has…
def list
@task_pages , @tasks = paginate :tasks, :per_page => 10
end
Thanks for any help/thoughts,
Stuart.
sbarlow
November 10, 2006, 1:04pm
2
Hi –
On Fri, 10 Nov 2006, sbarlow wrote:
validates_presence of :name
That should be:
validates_presence_of :name
David
–
David A. Black | [email protected]
Author of “Ruby for Rails” [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB’s Weblog) [2] | Co-director, Ruby Central, Inc. [4]
[1] Ruby for Rails | [3] http://www.rubypowerandlight.com
[2] http://dablog.rubypal.com | [4] http://www.rubycentral.org
sbarlow
November 10, 2006, 1:16pm
3
I am such a fool.
And thanks a million dollars (or even roublies)
Do you get questions like this often?
sbarlow
November 10, 2006, 1:56pm
4
Hi –
On Fri, 10 Nov 2006, sbarlow wrote:
I am such a fool.
And thanks a million dollars (or even roublies)
I’ll take any currency
Do you get questions like this often?
Sure. And I ask them occasionally. It’s why “RTFM” and “just Google
it” aren’t the whole story.
David
–
David A. Black | [email protected]
Author of “Ruby for Rails” [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB’s Weblog) [2] | Co-director, Ruby Central, Inc. [4]
[1] Ruby for Rails | [3] http://www.rubypowerandlight.com
[2] http://dablog.rubypal.com | [4] http://www.rubycentral.org