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.
C7d5bc5b054035d95f287797c2595694?d=identicon&s=25 matiassurdi (Guest)
on 2005-12-06 00: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..
C7d5bc5b054035d95f287797c2595694?d=identicon&s=25 matiassurdi (Guest)
on 2005-12-06 01:02
(Received via mailing list)
Matias Surdi
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..
0bcc972918891ef358b0b3dfb4e7f18b?d=identicon&s=25 hammed (Guest)
on 2005-12-06 03: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!
C7d5bc5b054035d95f287797c2595694?d=identicon&s=25 matiassurdi (Guest)
on 2005-12-06 12:34
(Received via mailing list)
Hammed Malik
escribió:>
>
>     mmmm
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails


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