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..
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..
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! On 05/12/05, Matias Surdi <matiassurdi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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.. > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hammed Malik escribió:> 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! > > On 05/12/05, *Matias Surdi* > <matiassurdi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > <mailto:matiassurdi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> wrote: > > 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.. > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > <mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/railsThanks!! Just what I was looking for......