does someone know how i controll the automatic messages populated by the validates_blahs? i think i swept my eyes across the fact that they may be in the enviorment.rb file, but now i can''t find anything (annoying). how do i controll the error_messages_for ... ? thanks for any references, etc. harp -- 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 -~----------~----~----~----~------~----~------~--~---
What I do in my apps, is this: validates_[whatever] params,params, :message=>''You misstyped something in this field'' Hope it helps. harper escribió:> > does someone know how i controll the automatic messages populated by the > validates_blahs? i think i swept my eyes across the fact that they may > be in the enviorment.rb file, but now i can''t find anything (annoying). > how do i controll the error_messages_for ... ? > > thanks for any references, etc. > > harp >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Hi, there is a problem i''ve been trying to solve for a couple of hours now, and after some useless googeling and searching around, i haven''t come up with anything substansial - i thought the forum might help me. say i have a string and want to display only the first 10 characters or so: shortstring = "this is a very long string object"[0..10] # shortstring = "this is a " # which is great but if i use the same method on a utf8 string, i get some weird characters popping in there, sometimes yes, sometimes no. from looking around it seems that because every character is two bytes(as apposed to 1 in regular encoding) there is sometimes a sum of odd/even characters, and then the [0..10] doesn''t work correctly, populating wierd characters. (same deal goes for the String#slice method) the final result i need, in essence of this message is this: "very long string in utf8" to become "very lon..." without weird characters. any help, much appreciated. thanks, harp -- 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 -~----------~----~----~----~------~----~------~--~---