Ruby on Rails Tuesday, August 24, 2010

What is the best way to tell rails to output a different name in the validation presented to the user than the actual attribute?


I have a field "trade_attached_pdf"
Which AR creates the error message "Trade attached pdf may only be in pdf format"

But I want the message to read "Attached pdf may only be in pdf format"

I found human_attribute_name in AR.base but is not clear how to implement. I have not done much with I18n, is that where I should perhaps be looking instead? 

David

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment