Dont use column name in errors

How can I customize Rails in order not to use the column name in the
error messages? I’d like to provide custom labels to be show in the
error messages.

On Wednesday 16 May 2007, Gabriel Bogea wrote:

How can I customize Rails in order not to use the column name in the
error messages? I’d like to provide custom labels to be show in the
error messages.

Hi Gabriel, I had the same problem

What I did was, copy the whole error_messages_for method from
ActiveRecordHelper
http://api.rubyonrails.org/classes/ActionView/Helpers/ActiveRecordHelper.html#M000568

and put it in my /app/helpers/application_helper.rb

then I just hacked the part that builds the header_message

actually my quibble was the object name, not the column names - but you
should be able to do what you like to it.

Maybe there is a better way though? seems this whole block of HTML
should be in a view in any case.

HTH
Sam

On 17 May 2007, at 01:42, Gabriel Bogea wrote:

How can I customize Rails in order not to use the column name in the
error messages? I’d like to provide custom labels to be show in the
error messages.

http://agilewebdevelopment.com/plugins/error_messages_for

Best regards

Peter De Berdt

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