richardun
2009-Sep-26 01:23 UTC
I''ve been trying to reply to a post, but none of my responses are taking...
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/cf59e09f98981f27/42caa6a0b45fd271#42caa6a0b45fd271
I''ve been trying to say this:
I responded just a bit ago, but I don''t see my response, so hopefully
there won''t be two responses...
Essentially, Drew, you can map the column to be something else when
you call "humanize" on it. Try this:
class Post < ActiveRecord::Base
HUMANIZED_COLUMNS = {:msg => "Message"}
def self.human_attribute_name(attribute)
HUMANIZED_COLUMNS[attribute.to_sym] || super
end
end
HTH,
Richard
On Sep 25, 4:49 pm, drewB
<dbats...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Is there an easy way to customize the display name of the attributed
> used in a validation error message. For example, let''s say I have
an
> active record with the attribute :msg that is validated for presence.
> If is doesn''t exist I don''t want the user to see
"msg can''t be
> blank!" I want it to say "Message can''t be blank!"
Is there an easy
> way to do that?
When I respond either through the web interface or in email, it says
it''s successful (in the browser), but my answers are not listed...
this was hours ago. Do I need to gain approval before posting
responses?