Error_message_on / error_messages_for


just a simple question between error_message_on / error_messages_for …
Well, if you use error_messages_for in your web page, there is no
problem even if anObject==nil (for example , the first time you load
your form) whereas error_message_on must be use with an instanciated
object …

So, you always has to double check if anObject is not nil before using
error_message_on ?

I don’t understand why there is a difference, I mean why you cannot
simply use <% error_message_on anObject, aMethod %> without evaluating
anObject ?



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs