Tim Conner wrote: > The reason that I am trying to use methods/attributes to store the > information rather than an array is because this model is used to create > a batch update form in a Rails project. If one of the updates fails > then I want to display the errors on the form next to the relevant > fields. For this to work, I will need to use the error_messages_for > helper to which I need to pass the attribute. > > Am I approaching this in the correct manner? I believe that ostruct by itself will do the job, or you can use method_missing to delegate to a hash without actually defining any methods. At least, I know this works for form helpers. You'd have to test it with validations and error_messages_for. -- Posted via http://www.ruby-forum.com/.