Forum: Ruby on Rails Overriding column names

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
matiassurdi (Guest)
on 2005-12-06 01:50
(Received via mailing list)
How can I override the returned value of model's human_name method???

I 've to change the value returned for some fields of some models...

Thanks..
matiassurdi (Guest)
on 2005-12-06 02:02
(Received via mailing list)
Matias S.
escribió:> How can I override the returned value of model's human_name method???
>
> I 've to change the value returned for some fields of some models...
>
> Thanks..

mmmm

it's from column object, not from model object...... :-(  sory..
hammed (Guest)
on 2005-12-06 04:49
(Received via mailing list)
You may be interesting in a plugin created by drawnboy. Following is
from
one of his earlier posts:

The new function customizes field names in the error view of validate.
Originaly this function is for localization to Japanese environments,
but I think it is also useful for in non-Japanese environments.

Example usage:

At a model file

set_field_names :title => 'Entry Name', :description => 'Entry
Description'

This changes the names of the error fields "title" and "description"
to "Entry Name" and "Entry Description", respectively.
And it also can change 2byte-charecter (not support DB server's field
name).

The plugin files are stored under
http://nowherenear.net:3333/tmp/set_field_names/

I hope you like it!
matiassurdi (Guest)
on 2005-12-06 13:34
(Received via mailing list)
Hammed M.
escribió:>
>
>     mmmm
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails


Thanks!! Just what I was looking for......
This topic is locked and can not be replied to.