How do you get rid of unwanted escape characters that rails adds to a user inputted string (e.g. like the forward slash in front of quotes, etc.?" Thanks, Cheri -- 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 Wed, 2008-01-30 at 23:59 +0100, Cheri Ruska wrote:> How do you get rid of unwanted escape characters that rails adds to a > user inputted string (e.g. like the forward slash in front of quotes, > etc.?"---- doesn''t ''h'' do that? <%=h @some_array.value %> Craig --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Craig White wrote:> On Wed, 2008-01-30 at 23:59 +0100, Cheri Ruska wrote: >> How do you get rid of unwanted escape characters that rails adds to a >> user inputted string (e.g. like the forward slash in front of quotes, >> etc.?" > ---- > doesn''t ''h'' do that? > > <%=h @some_array.value %> > > CraigThanks, but I want to get rid of them at the ruby level. - Cheri -- 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 Thu, 2008-01-31 at 00:34 +0100, Cheri Ruska wrote:> Craig White wrote: > > On Wed, 2008-01-30 at 23:59 +0100, Cheri Ruska wrote: > >> How do you get rid of unwanted escape characters that rails adds to a > >> user inputted string (e.g. like the forward slash in front of quotes, > >> etc.?" > > ---- > > doesn''t ''h'' do that? > > > > <%=h @some_array.value %> > > > > Craig > > Thanks, but I want to get rid of them at the ruby level. - Cheri---- gsub http://api.rubyonrails.org/classes/ActiveSupport/Multibyte/Chars.html#M000552 Craig --~--~---------~--~----~------------~-------~--~----~ 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 1/30/08, Craig White <craig-CnJ8jr4MGtxl57MIdRCFDg@public.gmane.org> wrote:> > > On Wed, 2008-01-30 at 23:59 +0100, Cheri Ruska wrote: > > How do you get rid of unwanted escape characters that rails adds to a > > user inputted string (e.g. like the forward slash in front of quotes, > > etc.?" > ---- > doesn''t ''h'' do that? > > <%=h @some_array.value %> >Actually h (alias for html_escape) does just the reverse, sort of. I think the OP might be a little confused since he talks about inserting forward slashes in front of quotes. This sound like he''s looking at the string in irb which uses inspect to display values, and string.inspect presents the string as it would appear in a ruby literal: irb(main):002:0> str = "\"To be or not to be\" is the beginning of Hamlet''s soliloquy" => "\"To be or not to be\" is the beginning of Hamlet''s soliloquy" irb(main):003:0> puts str "To be or not to be" is the beginning of Hamlet''s soliloquy => nil -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.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 -~----------~----~----~----~------~----~------~--~---