Hi, In my application I am using a list box where i am showing different groups name. I am using <%=truncate_html_strip_textual_wrap(group.name,28,28)%> for truncating the name but it gives me problem when group name come like Shital''s friends from "Office" Group this In list box it showing as a Shital''s friends from & quote.. how to avoid such a thing? whats a proper way for handling such a situations? character like single quote, double quote, ampersand not truncated properly please give me a standers way for doing it. -- 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 -~----------~----~----~----~------~----~------~--~---
On 18 Sep 2008, at 11:13, Sunny Bogawat wrote:> > Hi, > In my application I am using a list box where i am showing different > groups > name. I am using > <%=truncate_html_strip_textual_wrap(group.name,28,28)%> > for truncating the name but it gives me problem when group name come > like Shital''s friends from "Office" Group this > > In list box it showing as a Shital''s friends from & quote.. > how to avoid such a thing? whats a proper way for handling such a > situations? > > character like single quote, double quote, ampersand not truncated > properlytruncate before you escape html entities. Fred> > please give me a standers way for doing it. > -- > 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 -~----------~----~----~----~------~----~------~--~---
Could you explain with an example I am not understanding you? -- 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 -~----------~----~----~----~------~----~------~--~---
On 18 Sep 2008, at 11:30, Sunny Bogawat wrote:> > Could you explain with an example I am not understanding you?Your problem is that truncating works on a character by character basis, which has the inbuilt assumption that it''s ok to cut off at any point. If you have for example & then it''s not find to cut in the middle of that. Therefore it is a lot easier to do any truncation before you stick in the & and other things like that (or write a version of truncate that understands entities and that they should not be messed with. Fred> > -- > 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 -~----------~----~----~----~------~----~------~--~---
Ok, Thanks for suggestion do you know any JavaScript for handling such issue I am understanding it correctly. -- 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 -~----------~----~----~----~------~----~------~--~---