hi, i pass a general name object to my form and was wondering if i can overide the deafult title in the message box. is that possible besides overiding what is in active record? thanks. -- Posted via http://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
D. Taylor Singletary
2007-Jan-13 22:51 UTC
Re: error_messages_for, can i overide the name in the title?
There is a plugin that does what you want: http://agilewebdevelopment.com/plugins/error_messages_for I use it in my production applications and it''s quite useful. I don''t think I''ve even scratched the surface in my current iterations of what is possible and convient with it. The most important feature you''ll like of it is if you create a method called business_name in any of your models and have it return a string, that string will be used as the text when referring to that model. So in a model like this class Monday < AR::Blah::Blah def business_name "Tuesday" end end Monday becomes Tuesday. Taylor SIngletary, Reality Technician http://www.realitytechnicians.com On 1/13/07, poipu <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > hi, i pass a general name object to my form and was wondering if i can > overide the deafult title in the message box. is that possible besides > overiding what is in active record? > > > thanks. > > -- > Posted via http://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
mcintyre.tim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-13 22:53 UTC
Re: error_messages_for, can i overide the name in the title?
I''m not 100% sure I understand your question but does this help? in your model override the human_attribute_name method: def self.human_attribute_name(attribute) return "My Custom Name" if attribute == "name" etc... etc... end good luck! --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---