Topic: validation and messages

i have an Comments model which validates_presence_of :Note

it is my understanding that whenever i try to save a new record, it will fail if Note is blank, but it will also have a :message object.

how do i access the :message object in my controller method?

[code = ruby]
def create
   @comment = Comment.new()
   @comment.Note = CGI.escapeHTML(params['comment'])
   if @comment.save
     #render my new comments
   else
     #render the error message raised by the validation
   end
end
[/code]

Re: validation and messages

i figured it out.

the message is saved in.

@comment.errors.full_messages