Virtual Atrributes + error_message_for ploblem?


#1

Hello there,

I used a screencast ( http://railscasts.com/episodes/16 ) to make a
Nested form.
The problem is that when I will show the error_messages_for I will just
get a single line of error for each element that is related with the
main element.

Codes are here:

http://pastie.org/359215 - Invoice.rb
http://pastie.org/359217 - InvoiceItem.rb
http://pastie.org/359218 - Controller.rb

Error looks like this:

6 errors prohibited this Invoice from being saved
There were problems with the following fields:
* Invoice item is invalid
* Invoice item is invalid
* Invoice item is invalid
* Invoice item is invalid
* Invoice item is invalid
* Invoice item is invalid

What I was expecting to receive was some thing like:

6 errors prohibited this Invoice from being saved
There were problems with the following fields:
* Invoice item name can’t be black
* Invoice item price can’t be black
* Invoice item name is too short
* Invoice item name can’t be black
* Invoice item name is too long
* Invoice item price can’t be black

Anyone has an idea how to fix it?

Tks,

David S.


#2

Uhm… anyone?
The problem is not solved yet!

tks,

David S.