You could put this in your model (the one that maps to the table with
the email column) if you don't need to use the internationalisation
capabilities:
HUMAN_ATTRIBUTES = {:email => 'E-post'}
def self.human_attribute_name(attr)
HUMAN_ATTRIBUTES[attr.to_sym] || super
end
Note that you can rename more than one column:
HUMAN_ATTRIBUTES = {:email => 'E-post', :some_other_column => 'Another
name'}
On Oct 17, 10:31 am, Pål Bergström <[email protected]>
wrote:
> Marnen Laibow-Koser wrote:
> > Pål Bergström wrote:
> > [...]
> >> The column name in the db is 'email'. I would like that to be displayed
> >> in Swedish like 'E-post'.
>
> > And what's your view file like?
>
> > Best,
> > --
> > Marnen Laibow-Koser
> >http://www.marnen.org
> > [email protected]
>
> I mean in an error_messages_for. Sorry.
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---