That is exactly what I was looking for!  Thank you!

On Sep 25, 3:17 pm, richardun <[email protected]> wrote:
> 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 <[email protected]> wrote:
>
> > Is there an easy way to customize the display name of the attributed
> > used in a validationerrormessage.  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 "Messagecan't be blank!"  Is there an easy
> > way to do that?
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to