Overriding column names


#1

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…


#2

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… :frowning: sory…


#3

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!


#4

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…