Take the tour ×  I have a couple of simple models that are
associated like so:   class Task < ActiveRecord::Base
belongs_to :user   validates :name, :presence => true, :message
=> 'Name cannot be blank, Task not saved'  class User <
ActiveRecord::Base   has_many :tasks  VIEW has a call in it like
so: user.tasks <-- then I loop through the tasks  The Issue:  In
the task model --  when I use:   I get a 500 error:
ActionView::Template::Error (uninitialized constant User::Task):
NameError in View file  when I use:  validates_presence_of :name
Everything works.  I thought the both validates methods above
where the same...is the issue have to do with associations and
how validation tie into associated models. I have a hunch that
something is going on with the way things are associated, but it
is just a hunch.  Any help will be appreciated. Thank very much.
share|improve this question add comment  1 Answer  up vote 38
down vote accepted  When you use the newer validates :name
format, you can put multiple valida